Compare commits
144 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
58246f72dd | ||
|
|
b90ce2a2af | ||
|
|
4a0fc5ca0e | ||
|
|
c29d902b8e | ||
|
|
ab629c2048 | ||
|
|
e970ca49e8 | ||
|
|
99e78092ed | ||
|
|
4af91b5ab6 | ||
|
|
539121070a | ||
|
|
2a1bd92e1a | ||
|
|
2c1ebc0439 | ||
|
|
2d605f5dfb | ||
|
|
0cd09cf03a | ||
|
|
3ad1e8a3ba | ||
|
|
230722945e | ||
|
|
a429dcf978 | ||
|
|
0131031ac4 | ||
|
|
a418fc810a | ||
|
|
e71adbd26d | ||
|
|
8a525aee8a | ||
|
|
463b0fa28a | ||
|
|
007ebadf16 | ||
|
|
c7af81bf0c | ||
|
|
749508871b | ||
|
|
d112e0ea42 | ||
|
|
54f8771a9c | ||
|
|
0a3c83288e | ||
|
|
52a866147e | ||
|
|
6629eaf485 | ||
|
|
74239521cd | ||
|
|
8ae95c4e30 | ||
|
|
c31e191d7e | ||
|
|
c3134f779d | ||
|
|
d4749c139b | ||
|
|
63d6c32063 | ||
|
|
08299902e3 | ||
|
|
db04d6e642 | ||
|
|
6ddbd77009 | ||
|
|
4a4779fc63 | ||
|
|
46bb8d2cb5 | ||
|
|
31b2eeb293 | ||
|
|
8e9becd579 | ||
|
|
d067de086d | ||
|
|
8c6d395d89 | ||
|
|
f66b26a866 | ||
|
|
83f00d69ce | ||
|
|
8b2923b56d | ||
|
|
46af313c25 | ||
|
|
85dda759ec | ||
|
|
27fb44277f | ||
|
|
ea1aafbab2 | ||
|
|
2c446f939e | ||
|
|
47e427a851 | ||
|
|
95b8efae20 | ||
|
|
53774735d4 | ||
|
|
36c6c5a35e | ||
|
|
0beb07c87e | ||
|
|
64fd8e3be9 | ||
|
|
45c516ea3f | ||
|
|
26667c0a59 | ||
|
|
61e0379eb3 | ||
|
|
759df9bdd5 | ||
|
|
33e7ca08d8 | ||
|
|
c3d0d8bf63 | ||
|
|
8387f1e204 | ||
|
|
fe778293c1 | ||
|
|
991afb7722 | ||
|
|
a176542114 | ||
|
|
a3f555e816 | ||
|
|
dae5453e13 | ||
|
|
082826287e | ||
|
|
7418691cf3 | ||
|
|
29e72de64b | ||
|
|
4955b4a4a8 | ||
|
|
7c76595314 | ||
|
|
1495003103 | ||
|
|
fc1b74d48f | ||
|
|
830d0e9e7a | ||
|
|
7310c06162 | ||
|
|
045ccaa219 | ||
|
|
9d6a276342 | ||
|
|
9204d25b62 | ||
|
|
6c847292c7 | ||
|
|
b2712119d1 | ||
|
|
7728046309 | ||
|
|
17e18a2a7a | ||
|
|
ce8bedb340 | ||
|
|
14dc42e148 | ||
|
|
442c2294e9 | ||
|
|
5334514d55 | ||
|
|
0d5b431e6a | ||
|
|
8b10ee0028 | ||
|
|
9682abdded | ||
|
|
62cef0d141 | ||
|
|
548132ce7e | ||
|
|
4c19450f04 | ||
|
|
b4ee44ca00 | ||
|
|
f2db2ae474 | ||
|
|
f211b3a4da | ||
|
|
936f65ecc9 | ||
|
|
83985965f2 | ||
|
|
7bc38a35e8 | ||
|
|
9879f7fa0a | ||
|
|
7c856d08c4 | ||
|
|
6c554b4d51 | ||
|
|
187bc83db9 | ||
|
|
9a08379a5b | ||
|
|
e807d61bd7 | ||
|
|
f3724d6314 | ||
|
|
be8e393c13 | ||
|
|
0357f1461e | ||
|
|
8f99d80ac1 | ||
|
|
2c05b3b89f | ||
|
|
07bec16539 | ||
|
|
9938fdd4a2 | ||
|
|
320d2c5c96 | ||
|
|
6860cca9bb | ||
|
|
8e98eb439c | ||
|
|
29c4b8e6ee | ||
|
|
d8559a81f4 | ||
|
|
8322e49305 | ||
|
|
c0b6bf9f89 | ||
|
|
620d421a4b | ||
|
|
071ec61683 | ||
|
|
c0a532a0fe | ||
|
|
feb484dc9f | ||
|
|
4b819bbcc4 | ||
|
|
0257c5b30d | ||
|
|
3b1bb02e41 | ||
|
|
229dc03b23 | ||
|
|
2e883c2050 | ||
|
|
65abb1dfaa | ||
|
|
c72b551e80 | ||
|
|
9718e5aace | ||
|
|
db6ceea711 | ||
|
|
4a0e3227fc | ||
|
|
428e35237f | ||
|
|
74972336c6 | ||
|
|
fc1b825f46 | ||
|
|
8f1a8e3ce9 | ||
|
|
4efec0b266 | ||
|
|
9c0c819dce | ||
|
|
bb37372be0 | ||
|
|
fe8240c47a |
33
CONTRIBUTING.md
Normal file
@@ -0,0 +1,33 @@
|
||||
Code contributions are welcome! Please commit any pull requests against the `master` branch.
|
||||
|
||||
# Internationalization (i18n)
|
||||
|
||||
If you are interested in helping translate the bitwarden mobile app into another language, please follow these steps
|
||||
when creating your pull request:
|
||||
|
||||
1. Create a new resource file under `/src/App/Resources` by copy/pasting the master English file, `AppResources.resx`.
|
||||
2. Rename your `AppResources.resx` copy to include the proper .NET culture code for your language (typically the two
|
||||
letter code, ex. `sv`). You can find a list of culture codes here: <http://timtrott.co.uk/culture-codes/>. For
|
||||
example, if I want to create a new translation for Swedish, I will rename my `AppResources.resx` copy to
|
||||
`AppResources.sv.resx`.
|
||||
3. Open the `AppResources.XX.resx` file for your newly created language and start translating the `<value>` tags for
|
||||
each `<data>` element. The `<data>` and `<comment>` properties should not be translated and remain in English.
|
||||
4. Repeat the same process for the store `COPY.md` and `CAPTIONS.md` files in `/store/apple` and `/store/google` by
|
||||
creating a new folder for your language in each. Do not copy over the `assets` and `screenshots` folders to your new
|
||||
language. We will update these based on your translations provided in `CAPTIONS.md`. Finally, do not translate the
|
||||
titles in the markdown files (ex. `# Name` and `# Screenshot 1`). These are only for reference.
|
||||
5. If you have a Xamarin development environment setup, test your translations to make sure they look correct in the
|
||||
app on iOS and Android. Sometimes the UI can break due to translations taking up more space than the original UI was
|
||||
built for. If possible, use a shorter or abbreviated version of the word/sentence to accomedate the available space.
|
||||
If you are unable to accomedate the avaialable space for a particular translation, just let us know in your pull
|
||||
request comments. If you are unable to test your translations, just let us know in your pull request comments so
|
||||
that we can check it for you.
|
||||
6. Be sure to watch for [future changes](https://github.com/bitwarden/mobile/commits/master/src/App/Resources/AppResources.resx)
|
||||
to the `/src/App/Resources/AppResources.resx` file so that your translation will stay up to date.
|
||||
|
||||
You can find an example of a proper translation pull request here: <https://github.com/bitwarden/mobile/pull/22/files>
|
||||
|
||||
You can read more about localizing a Xamarin.Forms app here:
|
||||
<https://developer.xamarin.com/guides/xamarin-forms/advanced/localization/>
|
||||
|
||||
TIP: If you have Visual Studio installed, it provides a nice tabular UI for editing `resx` XML files.
|
||||
674
LICENSE.txt
Normal file
@@ -0,0 +1,674 @@
|
||||
GNU GENERAL PUBLIC LICENSE
|
||||
Version 3, 29 June 2007
|
||||
|
||||
Copyright (C) 2007 Free Software Foundation, Inc. <http://fsf.org/>
|
||||
Everyone is permitted to copy and distribute verbatim copies
|
||||
of this license document, but changing it is not allowed.
|
||||
|
||||
Preamble
|
||||
|
||||
The GNU General Public License is a free, copyleft license for
|
||||
software and other kinds of works.
|
||||
|
||||
The licenses for most software and other practical works are designed
|
||||
to take away your freedom to share and change the works. By contrast,
|
||||
the GNU General Public License is intended to guarantee your freedom to
|
||||
share and change all versions of a program--to make sure it remains free
|
||||
software for all its users. We, the Free Software Foundation, use the
|
||||
GNU General Public License for most of our software; it applies also to
|
||||
any other work released this way by its authors. You can apply it to
|
||||
your programs, too.
|
||||
|
||||
When we speak of free software, we are referring to freedom, not
|
||||
price. Our General Public Licenses are designed to make sure that you
|
||||
have the freedom to distribute copies of free software (and charge for
|
||||
them if you wish), that you receive source code or can get it if you
|
||||
want it, that you can change the software or use pieces of it in new
|
||||
free programs, and that you know you can do these things.
|
||||
|
||||
To protect your rights, we need to prevent others from denying you
|
||||
these rights or asking you to surrender the rights. Therefore, you have
|
||||
certain responsibilities if you distribute copies of the software, or if
|
||||
you modify it: responsibilities to respect the freedom of others.
|
||||
|
||||
For example, if you distribute copies of such a program, whether
|
||||
gratis or for a fee, you must pass on to the recipients the same
|
||||
freedoms that you received. You must make sure that they, too, receive
|
||||
or can get the source code. And you must show them these terms so they
|
||||
know their rights.
|
||||
|
||||
Developers that use the GNU GPL protect your rights with two steps:
|
||||
(1) assert copyright on the software, and (2) offer you this License
|
||||
giving you legal permission to copy, distribute and/or modify it.
|
||||
|
||||
For the developers' and authors' protection, the GPL clearly explains
|
||||
that there is no warranty for this free software. For both users' and
|
||||
authors' sake, the GPL requires that modified versions be marked as
|
||||
changed, so that their problems will not be attributed erroneously to
|
||||
authors of previous versions.
|
||||
|
||||
Some devices are designed to deny users access to install or run
|
||||
modified versions of the software inside them, although the manufacturer
|
||||
can do so. This is fundamentally incompatible with the aim of
|
||||
protecting users' freedom to change the software. The systematic
|
||||
pattern of such abuse occurs in the area of products for individuals to
|
||||
use, which is precisely where it is most unacceptable. Therefore, we
|
||||
have designed this version of the GPL to prohibit the practice for those
|
||||
products. If such problems arise substantially in other domains, we
|
||||
stand ready to extend this provision to those domains in future versions
|
||||
of the GPL, as needed to protect the freedom of users.
|
||||
|
||||
Finally, every program is threatened constantly by software patents.
|
||||
States should not allow patents to restrict development and use of
|
||||
software on general-purpose computers, but in those that do, we wish to
|
||||
avoid the special danger that patents applied to a free program could
|
||||
make it effectively proprietary. To prevent this, the GPL assures that
|
||||
patents cannot be used to render the program non-free.
|
||||
|
||||
The precise terms and conditions for copying, distribution and
|
||||
modification follow.
|
||||
|
||||
TERMS AND CONDITIONS
|
||||
|
||||
0. Definitions.
|
||||
|
||||
"This License" refers to version 3 of the GNU General Public License.
|
||||
|
||||
"Copyright" also means copyright-like laws that apply to other kinds of
|
||||
works, such as semiconductor masks.
|
||||
|
||||
"The Program" refers to any copyrightable work licensed under this
|
||||
License. Each licensee is addressed as "you". "Licensees" and
|
||||
"recipients" may be individuals or organizations.
|
||||
|
||||
To "modify" a work means to copy from or adapt all or part of the work
|
||||
in a fashion requiring copyright permission, other than the making of an
|
||||
exact copy. The resulting work is called a "modified version" of the
|
||||
earlier work or a work "based on" the earlier work.
|
||||
|
||||
A "covered work" means either the unmodified Program or a work based
|
||||
on the Program.
|
||||
|
||||
To "propagate" a work means to do anything with it that, without
|
||||
permission, would make you directly or secondarily liable for
|
||||
infringement under applicable copyright law, except executing it on a
|
||||
computer or modifying a private copy. Propagation includes copying,
|
||||
distribution (with or without modification), making available to the
|
||||
public, and in some countries other activities as well.
|
||||
|
||||
To "convey" a work means any kind of propagation that enables other
|
||||
parties to make or receive copies. Mere interaction with a user through
|
||||
a computer network, with no transfer of a copy, is not conveying.
|
||||
|
||||
An interactive user interface displays "Appropriate Legal Notices"
|
||||
to the extent that it includes a convenient and prominently visible
|
||||
feature that (1) displays an appropriate copyright notice, and (2)
|
||||
tells the user that there is no warranty for the work (except to the
|
||||
extent that warranties are provided), that licensees may convey the
|
||||
work under this License, and how to view a copy of this License. If
|
||||
the interface presents a list of user commands or options, such as a
|
||||
menu, a prominent item in the list meets this criterion.
|
||||
|
||||
1. Source Code.
|
||||
|
||||
The "source code" for a work means the preferred form of the work
|
||||
for making modifications to it. "Object code" means any non-source
|
||||
form of a work.
|
||||
|
||||
A "Standard Interface" means an interface that either is an official
|
||||
standard defined by a recognized standards body, or, in the case of
|
||||
interfaces specified for a particular programming language, one that
|
||||
is widely used among developers working in that language.
|
||||
|
||||
The "System Libraries" of an executable work include anything, other
|
||||
than the work as a whole, that (a) is included in the normal form of
|
||||
packaging a Major Component, but which is not part of that Major
|
||||
Component, and (b) serves only to enable use of the work with that
|
||||
Major Component, or to implement a Standard Interface for which an
|
||||
implementation is available to the public in source code form. A
|
||||
"Major Component", in this context, means a major essential component
|
||||
(kernel, window system, and so on) of the specific operating system
|
||||
(if any) on which the executable work runs, or a compiler used to
|
||||
produce the work, or an object code interpreter used to run it.
|
||||
|
||||
The "Corresponding Source" for a work in object code form means all
|
||||
the source code needed to generate, install, and (for an executable
|
||||
work) run the object code and to modify the work, including scripts to
|
||||
control those activities. However, it does not include the work's
|
||||
System Libraries, or general-purpose tools or generally available free
|
||||
programs which are used unmodified in performing those activities but
|
||||
which are not part of the work. For example, Corresponding Source
|
||||
includes interface definition files associated with source files for
|
||||
the work, and the source code for shared libraries and dynamically
|
||||
linked subprograms that the work is specifically designed to require,
|
||||
such as by intimate data communication or control flow between those
|
||||
subprograms and other parts of the work.
|
||||
|
||||
The Corresponding Source need not include anything that users
|
||||
can regenerate automatically from other parts of the Corresponding
|
||||
Source.
|
||||
|
||||
The Corresponding Source for a work in source code form is that
|
||||
same work.
|
||||
|
||||
2. Basic Permissions.
|
||||
|
||||
All rights granted under this License are granted for the term of
|
||||
copyright on the Program, and are irrevocable provided the stated
|
||||
conditions are met. This License explicitly affirms your unlimited
|
||||
permission to run the unmodified Program. The output from running a
|
||||
covered work is covered by this License only if the output, given its
|
||||
content, constitutes a covered work. This License acknowledges your
|
||||
rights of fair use or other equivalent, as provided by copyright law.
|
||||
|
||||
You may make, run and propagate covered works that you do not
|
||||
convey, without conditions so long as your license otherwise remains
|
||||
in force. You may convey covered works to others for the sole purpose
|
||||
of having them make modifications exclusively for you, or provide you
|
||||
with facilities for running those works, provided that you comply with
|
||||
the terms of this License in conveying all material for which you do
|
||||
not control copyright. Those thus making or running the covered works
|
||||
for you must do so exclusively on your behalf, under your direction
|
||||
and control, on terms that prohibit them from making any copies of
|
||||
your copyrighted material outside their relationship with you.
|
||||
|
||||
Conveying under any other circumstances is permitted solely under
|
||||
the conditions stated below. Sublicensing is not allowed; section 10
|
||||
makes it unnecessary.
|
||||
|
||||
3. Protecting Users' Legal Rights From Anti-Circumvention Law.
|
||||
|
||||
No covered work shall be deemed part of an effective technological
|
||||
measure under any applicable law fulfilling obligations under article
|
||||
11 of the WIPO copyright treaty adopted on 20 December 1996, or
|
||||
similar laws prohibiting or restricting circumvention of such
|
||||
measures.
|
||||
|
||||
When you convey a covered work, you waive any legal power to forbid
|
||||
circumvention of technological measures to the extent such circumvention
|
||||
is effected by exercising rights under this License with respect to
|
||||
the covered work, and you disclaim any intention to limit operation or
|
||||
modification of the work as a means of enforcing, against the work's
|
||||
users, your or third parties' legal rights to forbid circumvention of
|
||||
technological measures.
|
||||
|
||||
4. Conveying Verbatim Copies.
|
||||
|
||||
You may convey verbatim copies of the Program's source code as you
|
||||
receive it, in any medium, provided that you conspicuously and
|
||||
appropriately publish on each copy an appropriate copyright notice;
|
||||
keep intact all notices stating that this License and any
|
||||
non-permissive terms added in accord with section 7 apply to the code;
|
||||
keep intact all notices of the absence of any warranty; and give all
|
||||
recipients a copy of this License along with the Program.
|
||||
|
||||
You may charge any price or no price for each copy that you convey,
|
||||
and you may offer support or warranty protection for a fee.
|
||||
|
||||
5. Conveying Modified Source Versions.
|
||||
|
||||
You may convey a work based on the Program, or the modifications to
|
||||
produce it from the Program, in the form of source code under the
|
||||
terms of section 4, provided that you also meet all of these conditions:
|
||||
|
||||
a) The work must carry prominent notices stating that you modified
|
||||
it, and giving a relevant date.
|
||||
|
||||
b) The work must carry prominent notices stating that it is
|
||||
released under this License and any conditions added under section
|
||||
7. This requirement modifies the requirement in section 4 to
|
||||
"keep intact all notices".
|
||||
|
||||
c) You must license the entire work, as a whole, under this
|
||||
License to anyone who comes into possession of a copy. This
|
||||
License will therefore apply, along with any applicable section 7
|
||||
additional terms, to the whole of the work, and all its parts,
|
||||
regardless of how they are packaged. This License gives no
|
||||
permission to license the work in any other way, but it does not
|
||||
invalidate such permission if you have separately received it.
|
||||
|
||||
d) If the work has interactive user interfaces, each must display
|
||||
Appropriate Legal Notices; however, if the Program has interactive
|
||||
interfaces that do not display Appropriate Legal Notices, your
|
||||
work need not make them do so.
|
||||
|
||||
A compilation of a covered work with other separate and independent
|
||||
works, which are not by their nature extensions of the covered work,
|
||||
and which are not combined with it such as to form a larger program,
|
||||
in or on a volume of a storage or distribution medium, is called an
|
||||
"aggregate" if the compilation and its resulting copyright are not
|
||||
used to limit the access or legal rights of the compilation's users
|
||||
beyond what the individual works permit. Inclusion of a covered work
|
||||
in an aggregate does not cause this License to apply to the other
|
||||
parts of the aggregate.
|
||||
|
||||
6. Conveying Non-Source Forms.
|
||||
|
||||
You may convey a covered work in object code form under the terms
|
||||
of sections 4 and 5, provided that you also convey the
|
||||
machine-readable Corresponding Source under the terms of this License,
|
||||
in one of these ways:
|
||||
|
||||
a) Convey the object code in, or embodied in, a physical product
|
||||
(including a physical distribution medium), accompanied by the
|
||||
Corresponding Source fixed on a durable physical medium
|
||||
customarily used for software interchange.
|
||||
|
||||
b) Convey the object code in, or embodied in, a physical product
|
||||
(including a physical distribution medium), accompanied by a
|
||||
written offer, valid for at least three years and valid for as
|
||||
long as you offer spare parts or customer support for that product
|
||||
model, to give anyone who possesses the object code either (1) a
|
||||
copy of the Corresponding Source for all the software in the
|
||||
product that is covered by this License, on a durable physical
|
||||
medium customarily used for software interchange, for a price no
|
||||
more than your reasonable cost of physically performing this
|
||||
conveying of source, or (2) access to copy the
|
||||
Corresponding Source from a network server at no charge.
|
||||
|
||||
c) Convey individual copies of the object code with a copy of the
|
||||
written offer to provide the Corresponding Source. This
|
||||
alternative is allowed only occasionally and noncommercially, and
|
||||
only if you received the object code with such an offer, in accord
|
||||
with subsection 6b.
|
||||
|
||||
d) Convey the object code by offering access from a designated
|
||||
place (gratis or for a charge), and offer equivalent access to the
|
||||
Corresponding Source in the same way through the same place at no
|
||||
further charge. You need not require recipients to copy the
|
||||
Corresponding Source along with the object code. If the place to
|
||||
copy the object code is a network server, the Corresponding Source
|
||||
may be on a different server (operated by you or a third party)
|
||||
that supports equivalent copying facilities, provided you maintain
|
||||
clear directions next to the object code saying where to find the
|
||||
Corresponding Source. Regardless of what server hosts the
|
||||
Corresponding Source, you remain obligated to ensure that it is
|
||||
available for as long as needed to satisfy these requirements.
|
||||
|
||||
e) Convey the object code using peer-to-peer transmission, provided
|
||||
you inform other peers where the object code and Corresponding
|
||||
Source of the work are being offered to the general public at no
|
||||
charge under subsection 6d.
|
||||
|
||||
A separable portion of the object code, whose source code is excluded
|
||||
from the Corresponding Source as a System Library, need not be
|
||||
included in conveying the object code work.
|
||||
|
||||
A "User Product" is either (1) a "consumer product", which means any
|
||||
tangible personal property which is normally used for personal, family,
|
||||
or household purposes, or (2) anything designed or sold for incorporation
|
||||
into a dwelling. In determining whether a product is a consumer product,
|
||||
doubtful cases shall be resolved in favor of coverage. For a particular
|
||||
product received by a particular user, "normally used" refers to a
|
||||
typical or common use of that class of product, regardless of the status
|
||||
of the particular user or of the way in which the particular user
|
||||
actually uses, or expects or is expected to use, the product. A product
|
||||
is a consumer product regardless of whether the product has substantial
|
||||
commercial, industrial or non-consumer uses, unless such uses represent
|
||||
the only significant mode of use of the product.
|
||||
|
||||
"Installation Information" for a User Product means any methods,
|
||||
procedures, authorization keys, or other information required to install
|
||||
and execute modified versions of a covered work in that User Product from
|
||||
a modified version of its Corresponding Source. The information must
|
||||
suffice to ensure that the continued functioning of the modified object
|
||||
code is in no case prevented or interfered with solely because
|
||||
modification has been made.
|
||||
|
||||
If you convey an object code work under this section in, or with, or
|
||||
specifically for use in, a User Product, and the conveying occurs as
|
||||
part of a transaction in which the right of possession and use of the
|
||||
User Product is transferred to the recipient in perpetuity or for a
|
||||
fixed term (regardless of how the transaction is characterized), the
|
||||
Corresponding Source conveyed under this section must be accompanied
|
||||
by the Installation Information. But this requirement does not apply
|
||||
if neither you nor any third party retains the ability to install
|
||||
modified object code on the User Product (for example, the work has
|
||||
been installed in ROM).
|
||||
|
||||
The requirement to provide Installation Information does not include a
|
||||
requirement to continue to provide support service, warranty, or updates
|
||||
for a work that has been modified or installed by the recipient, or for
|
||||
the User Product in which it has been modified or installed. Access to a
|
||||
network may be denied when the modification itself materially and
|
||||
adversely affects the operation of the network or violates the rules and
|
||||
protocols for communication across the network.
|
||||
|
||||
Corresponding Source conveyed, and Installation Information provided,
|
||||
in accord with this section must be in a format that is publicly
|
||||
documented (and with an implementation available to the public in
|
||||
source code form), and must require no special password or key for
|
||||
unpacking, reading or copying.
|
||||
|
||||
7. Additional Terms.
|
||||
|
||||
"Additional permissions" are terms that supplement the terms of this
|
||||
License by making exceptions from one or more of its conditions.
|
||||
Additional permissions that are applicable to the entire Program shall
|
||||
be treated as though they were included in this License, to the extent
|
||||
that they are valid under applicable law. If additional permissions
|
||||
apply only to part of the Program, that part may be used separately
|
||||
under those permissions, but the entire Program remains governed by
|
||||
this License without regard to the additional permissions.
|
||||
|
||||
When you convey a copy of a covered work, you may at your option
|
||||
remove any additional permissions from that copy, or from any part of
|
||||
it. (Additional permissions may be written to require their own
|
||||
removal in certain cases when you modify the work.) You may place
|
||||
additional permissions on material, added by you to a covered work,
|
||||
for which you have or can give appropriate copyright permission.
|
||||
|
||||
Notwithstanding any other provision of this License, for material you
|
||||
add to a covered work, you may (if authorized by the copyright holders of
|
||||
that material) supplement the terms of this License with terms:
|
||||
|
||||
a) Disclaiming warranty or limiting liability differently from the
|
||||
terms of sections 15 and 16 of this License; or
|
||||
|
||||
b) Requiring preservation of specified reasonable legal notices or
|
||||
author attributions in that material or in the Appropriate Legal
|
||||
Notices displayed by works containing it; or
|
||||
|
||||
c) Prohibiting misrepresentation of the origin of that material, or
|
||||
requiring that modified versions of such material be marked in
|
||||
reasonable ways as different from the original version; or
|
||||
|
||||
d) Limiting the use for publicity purposes of names of licensors or
|
||||
authors of the material; or
|
||||
|
||||
e) Declining to grant rights under trademark law for use of some
|
||||
trade names, trademarks, or service marks; or
|
||||
|
||||
f) Requiring indemnification of licensors and authors of that
|
||||
material by anyone who conveys the material (or modified versions of
|
||||
it) with contractual assumptions of liability to the recipient, for
|
||||
any liability that these contractual assumptions directly impose on
|
||||
those licensors and authors.
|
||||
|
||||
All other non-permissive additional terms are considered "further
|
||||
restrictions" within the meaning of section 10. If the Program as you
|
||||
received it, or any part of it, contains a notice stating that it is
|
||||
governed by this License along with a term that is a further
|
||||
restriction, you may remove that term. If a license document contains
|
||||
a further restriction but permits relicensing or conveying under this
|
||||
License, you may add to a covered work material governed by the terms
|
||||
of that license document, provided that the further restriction does
|
||||
not survive such relicensing or conveying.
|
||||
|
||||
If you add terms to a covered work in accord with this section, you
|
||||
must place, in the relevant source files, a statement of the
|
||||
additional terms that apply to those files, or a notice indicating
|
||||
where to find the applicable terms.
|
||||
|
||||
Additional terms, permissive or non-permissive, may be stated in the
|
||||
form of a separately written license, or stated as exceptions;
|
||||
the above requirements apply either way.
|
||||
|
||||
8. Termination.
|
||||
|
||||
You may not propagate or modify a covered work except as expressly
|
||||
provided under this License. Any attempt otherwise to propagate or
|
||||
modify it is void, and will automatically terminate your rights under
|
||||
this License (including any patent licenses granted under the third
|
||||
paragraph of section 11).
|
||||
|
||||
However, if you cease all violation of this License, then your
|
||||
license from a particular copyright holder is reinstated (a)
|
||||
provisionally, unless and until the copyright holder explicitly and
|
||||
finally terminates your license, and (b) permanently, if the copyright
|
||||
holder fails to notify you of the violation by some reasonable means
|
||||
prior to 60 days after the cessation.
|
||||
|
||||
Moreover, your license from a particular copyright holder is
|
||||
reinstated permanently if the copyright holder notifies you of the
|
||||
violation by some reasonable means, this is the first time you have
|
||||
received notice of violation of this License (for any work) from that
|
||||
copyright holder, and you cure the violation prior to 30 days after
|
||||
your receipt of the notice.
|
||||
|
||||
Termination of your rights under this section does not terminate the
|
||||
licenses of parties who have received copies or rights from you under
|
||||
this License. If your rights have been terminated and not permanently
|
||||
reinstated, you do not qualify to receive new licenses for the same
|
||||
material under section 10.
|
||||
|
||||
9. Acceptance Not Required for Having Copies.
|
||||
|
||||
You are not required to accept this License in order to receive or
|
||||
run a copy of the Program. Ancillary propagation of a covered work
|
||||
occurring solely as a consequence of using peer-to-peer transmission
|
||||
to receive a copy likewise does not require acceptance. However,
|
||||
nothing other than this License grants you permission to propagate or
|
||||
modify any covered work. These actions infringe copyright if you do
|
||||
not accept this License. Therefore, by modifying or propagating a
|
||||
covered work, you indicate your acceptance of this License to do so.
|
||||
|
||||
10. Automatic Licensing of Downstream Recipients.
|
||||
|
||||
Each time you convey a covered work, the recipient automatically
|
||||
receives a license from the original licensors, to run, modify and
|
||||
propagate that work, subject to this License. You are not responsible
|
||||
for enforcing compliance by third parties with this License.
|
||||
|
||||
An "entity transaction" is a transaction transferring control of an
|
||||
organization, or substantially all assets of one, or subdividing an
|
||||
organization, or merging organizations. If propagation of a covered
|
||||
work results from an entity transaction, each party to that
|
||||
transaction who receives a copy of the work also receives whatever
|
||||
licenses to the work the party's predecessor in interest had or could
|
||||
give under the previous paragraph, plus a right to possession of the
|
||||
Corresponding Source of the work from the predecessor in interest, if
|
||||
the predecessor has it or can get it with reasonable efforts.
|
||||
|
||||
You may not impose any further restrictions on the exercise of the
|
||||
rights granted or affirmed under this License. For example, you may
|
||||
not impose a license fee, royalty, or other charge for exercise of
|
||||
rights granted under this License, and you may not initiate litigation
|
||||
(including a cross-claim or counterclaim in a lawsuit) alleging that
|
||||
any patent claim is infringed by making, using, selling, offering for
|
||||
sale, or importing the Program or any portion of it.
|
||||
|
||||
11. Patents.
|
||||
|
||||
A "contributor" is a copyright holder who authorizes use under this
|
||||
License of the Program or a work on which the Program is based. The
|
||||
work thus licensed is called the contributor's "contributor version".
|
||||
|
||||
A contributor's "essential patent claims" are all patent claims
|
||||
owned or controlled by the contributor, whether already acquired or
|
||||
hereafter acquired, that would be infringed by some manner, permitted
|
||||
by this License, of making, using, or selling its contributor version,
|
||||
but do not include claims that would be infringed only as a
|
||||
consequence of further modification of the contributor version. For
|
||||
purposes of this definition, "control" includes the right to grant
|
||||
patent sublicenses in a manner consistent with the requirements of
|
||||
this License.
|
||||
|
||||
Each contributor grants you a non-exclusive, worldwide, royalty-free
|
||||
patent license under the contributor's essential patent claims, to
|
||||
make, use, sell, offer for sale, import and otherwise run, modify and
|
||||
propagate the contents of its contributor version.
|
||||
|
||||
In the following three paragraphs, a "patent license" is any express
|
||||
agreement or commitment, however denominated, not to enforce a patent
|
||||
(such as an express permission to practice a patent or covenant not to
|
||||
sue for patent infringement). To "grant" such a patent license to a
|
||||
party means to make such an agreement or commitment not to enforce a
|
||||
patent against the party.
|
||||
|
||||
If you convey a covered work, knowingly relying on a patent license,
|
||||
and the Corresponding Source of the work is not available for anyone
|
||||
to copy, free of charge and under the terms of this License, through a
|
||||
publicly available network server or other readily accessible means,
|
||||
then you must either (1) cause the Corresponding Source to be so
|
||||
available, or (2) arrange to deprive yourself of the benefit of the
|
||||
patent license for this particular work, or (3) arrange, in a manner
|
||||
consistent with the requirements of this License, to extend the patent
|
||||
license to downstream recipients. "Knowingly relying" means you have
|
||||
actual knowledge that, but for the patent license, your conveying the
|
||||
covered work in a country, or your recipient's use of the covered work
|
||||
in a country, would infringe one or more identifiable patents in that
|
||||
country that you have reason to believe are valid.
|
||||
|
||||
If, pursuant to or in connection with a single transaction or
|
||||
arrangement, you convey, or propagate by procuring conveyance of, a
|
||||
covered work, and grant a patent license to some of the parties
|
||||
receiving the covered work authorizing them to use, propagate, modify
|
||||
or convey a specific copy of the covered work, then the patent license
|
||||
you grant is automatically extended to all recipients of the covered
|
||||
work and works based on it.
|
||||
|
||||
A patent license is "discriminatory" if it does not include within
|
||||
the scope of its coverage, prohibits the exercise of, or is
|
||||
conditioned on the non-exercise of one or more of the rights that are
|
||||
specifically granted under this License. You may not convey a covered
|
||||
work if you are a party to an arrangement with a third party that is
|
||||
in the business of distributing software, under which you make payment
|
||||
to the third party based on the extent of your activity of conveying
|
||||
the work, and under which the third party grants, to any of the
|
||||
parties who would receive the covered work from you, a discriminatory
|
||||
patent license (a) in connection with copies of the covered work
|
||||
conveyed by you (or copies made from those copies), or (b) primarily
|
||||
for and in connection with specific products or compilations that
|
||||
contain the covered work, unless you entered into that arrangement,
|
||||
or that patent license was granted, prior to 28 March 2007.
|
||||
|
||||
Nothing in this License shall be construed as excluding or limiting
|
||||
any implied license or other defenses to infringement that may
|
||||
otherwise be available to you under applicable patent law.
|
||||
|
||||
12. No Surrender of Others' Freedom.
|
||||
|
||||
If conditions are imposed on you (whether by court order, agreement or
|
||||
otherwise) that contradict the conditions of this License, they do not
|
||||
excuse you from the conditions of this License. If you cannot convey a
|
||||
covered work so as to satisfy simultaneously your obligations under this
|
||||
License and any other pertinent obligations, then as a consequence you may
|
||||
not convey it at all. For example, if you agree to terms that obligate you
|
||||
to collect a royalty for further conveying from those to whom you convey
|
||||
the Program, the only way you could satisfy both those terms and this
|
||||
License would be to refrain entirely from conveying the Program.
|
||||
|
||||
13. Use with the GNU Affero General Public License.
|
||||
|
||||
Notwithstanding any other provision of this License, you have
|
||||
permission to link or combine any covered work with a work licensed
|
||||
under version 3 of the GNU Affero General Public License into a single
|
||||
combined work, and to convey the resulting work. The terms of this
|
||||
License will continue to apply to the part which is the covered work,
|
||||
but the special requirements of the GNU Affero General Public License,
|
||||
section 13, concerning interaction through a network will apply to the
|
||||
combination as such.
|
||||
|
||||
14. Revised Versions of this License.
|
||||
|
||||
The Free Software Foundation may publish revised and/or new versions of
|
||||
the GNU General Public License from time to time. Such new versions will
|
||||
be similar in spirit to the present version, but may differ in detail to
|
||||
address new problems or concerns.
|
||||
|
||||
Each version is given a distinguishing version number. If the
|
||||
Program specifies that a certain numbered version of the GNU General
|
||||
Public License "or any later version" applies to it, you have the
|
||||
option of following the terms and conditions either of that numbered
|
||||
version or of any later version published by the Free Software
|
||||
Foundation. If the Program does not specify a version number of the
|
||||
GNU General Public License, you may choose any version ever published
|
||||
by the Free Software Foundation.
|
||||
|
||||
If the Program specifies that a proxy can decide which future
|
||||
versions of the GNU General Public License can be used, that proxy's
|
||||
public statement of acceptance of a version permanently authorizes you
|
||||
to choose that version for the Program.
|
||||
|
||||
Later license versions may give you additional or different
|
||||
permissions. However, no additional obligations are imposed on any
|
||||
author or copyright holder as a result of your choosing to follow a
|
||||
later version.
|
||||
|
||||
15. Disclaimer of Warranty.
|
||||
|
||||
THERE IS NO WARRANTY FOR THE PROGRAM, TO THE EXTENT PERMITTED BY
|
||||
APPLICABLE LAW. EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT
|
||||
HOLDERS AND/OR OTHER PARTIES PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY
|
||||
OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO,
|
||||
THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
|
||||
PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE PROGRAM
|
||||
IS WITH YOU. SHOULD THE PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF
|
||||
ALL NECESSARY SERVICING, REPAIR OR CORRECTION.
|
||||
|
||||
16. Limitation of Liability.
|
||||
|
||||
IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING
|
||||
WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MODIFIES AND/OR CONVEYS
|
||||
THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, INCLUDING ANY
|
||||
GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE
|
||||
USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED TO LOSS OF
|
||||
DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD
|
||||
PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER PROGRAMS),
|
||||
EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF
|
||||
SUCH DAMAGES.
|
||||
|
||||
17. Interpretation of Sections 15 and 16.
|
||||
|
||||
If the disclaimer of warranty and limitation of liability provided
|
||||
above cannot be given local legal effect according to their terms,
|
||||
reviewing courts shall apply local law that most closely approximates
|
||||
an absolute waiver of all civil liability in connection with the
|
||||
Program, unless a warranty or assumption of liability accompanies a
|
||||
copy of the Program in return for a fee.
|
||||
|
||||
END OF TERMS AND CONDITIONS
|
||||
|
||||
How to Apply These Terms to Your New Programs
|
||||
|
||||
If you develop a new program, and you want it to be of the greatest
|
||||
possible use to the public, the best way to achieve this is to make it
|
||||
free software which everyone can redistribute and change under these terms.
|
||||
|
||||
To do so, attach the following notices to the program. It is safest
|
||||
to attach them to the start of each source file to most effectively
|
||||
state the exclusion of warranty; and each file should have at least
|
||||
the "copyright" line and a pointer to where the full notice is found.
|
||||
|
||||
{one line to give the program's name and a brief idea of what it does.}
|
||||
Copyright (C) {year} {name of author}
|
||||
|
||||
This program is free software: you can redistribute it and/or modify
|
||||
it under the terms of the GNU General Public License as published by
|
||||
the Free Software Foundation, either version 3 of the License, or
|
||||
(at your option) any later version.
|
||||
|
||||
This program is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
GNU General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU General Public License
|
||||
along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
|
||||
Also add information on how to contact you by electronic and paper mail.
|
||||
|
||||
If the program does terminal interaction, make it output a short
|
||||
notice like this when it starts in an interactive mode:
|
||||
|
||||
{project} Copyright (C) {year} {fullname}
|
||||
This program comes with ABSOLUTELY NO WARRANTY; for details type `show w'.
|
||||
This is free software, and you are welcome to redistribute it
|
||||
under certain conditions; type `show c' for details.
|
||||
|
||||
The hypothetical commands `show w' and `show c' should show the appropriate
|
||||
parts of the General Public License. Of course, your program's commands
|
||||
might be different; for a GUI interface, you would use an "about box".
|
||||
|
||||
You should also get your employer (if you work as a programmer) or school,
|
||||
if any, to sign a "copyright disclaimer" for the program, if necessary.
|
||||
For more information on this, and how to apply and follow the GNU GPL, see
|
||||
<http://www.gnu.org/licenses/>.
|
||||
|
||||
The GNU General Public License does not permit incorporating your program
|
||||
into proprietary programs. If your program is a subroutine library, you
|
||||
may consider it more useful to permit linking proprietary applications with
|
||||
the library. If this is what you want to do, use the GNU Lesser General
|
||||
Public License instead of this License. But first, please read
|
||||
<http://www.gnu.org/philosophy/why-not-lgpl.html>.
|
||||
16
README.md
@@ -1,11 +1,27 @@
|
||||
[] (https://ci.appveyor.com/project/bitwarden/mobile)
|
||||
[](https://gitter.im/bitwarden/Lobby)
|
||||
|
||||
# bitwarden mobile
|
||||
|
||||
<a href="https://play.google.com/store/apps/details?id=com.x8bit.bitwarden" target="_blank"><img alt="Get it on Google Play" src="https://developer.android.com/images/brand/en_generic_rgb_wo_45.png"width="129" height="45"></a> <a href="https://itunes.apple.com/us/app/bitwarden-free-password-manager/id1137397744?mt=8" target="_blank"><img src="https://linkmaker.itunes.apple.com/images/badges/en-us/badge_appstore-lrg.svg" width="165" height="40"></a>
|
||||
|
||||
The bitwarden mobile application is written in C# with Xamarin Android, Xamarin iOS, and Xamarin Forms.
|
||||
|
||||
# Build/Run
|
||||
|
||||
**Requirements**
|
||||
|
||||
- [Visual Studio w/ Xamarin -or- Xamarin Studio](https://store.xamarin.com/)
|
||||
|
||||
By default the app is targeting the production API. If you are running the [Core](https://github.com/bitwarden/core) API locally,
|
||||
you'll need to switch the extension to target your local API. Open `src/App/Utilities/ApiHttpClient.cs` and set `BaseAddress` to your local
|
||||
API instance (ex. `new Uri("http://localhost:4000")`).
|
||||
|
||||
After restoring the nuget packages, you can now build and run the app.
|
||||
|
||||
# Contribute
|
||||
|
||||
Code contributions are welcome! Visual Studio or Xamarin Studio is required to work on this project. Please commit any pull requests against the `master` branch.
|
||||
Learn more about how to contribute by reading the [`CONTRIBUTING.md`](CONTRIBUTING.md) file.
|
||||
|
||||
Security audits and feedback are welcome. Please open an issue or email us privately if the report is sensitive in nature.
|
||||
|
||||
@@ -23,6 +23,12 @@ Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "iOS.Test", "test\iOS.Test\i
|
||||
EndProject
|
||||
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Android.Test", "test\Android.Test\Android.Test.csproj", "{FA507A17-D4E3-46DF-ACD8-D7E6D7D4E3AE}"
|
||||
EndProject
|
||||
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "store", "store", "{92470CBD-9047-4C3C-8EA3-D972D6622D84}"
|
||||
EndProject
|
||||
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "google", "google", "{2E399654-26A2-46F6-B9CA-1B496A3F370A}"
|
||||
EndProject
|
||||
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Publisher", "store\google\Publisher\Publisher.csproj", "{428CACAB-CC26-4F41-9062-1E4A9BC82640}"
|
||||
EndProject
|
||||
Global
|
||||
GlobalSection(SolutionConfigurationPlatforms) = preSolution
|
||||
Ad-Hoc|Any CPU = Ad-Hoc|Any CPU
|
||||
@@ -411,6 +417,54 @@ Global
|
||||
{FA507A17-D4E3-46DF-ACD8-D7E6D7D4E3AE}.Release|x86.ActiveCfg = Release|Any CPU
|
||||
{FA507A17-D4E3-46DF-ACD8-D7E6D7D4E3AE}.Release|x86.Build.0 = Release|Any CPU
|
||||
{FA507A17-D4E3-46DF-ACD8-D7E6D7D4E3AE}.Release|x86.Deploy.0 = Release|Any CPU
|
||||
{428CACAB-CC26-4F41-9062-1E4A9BC82640}.Ad-Hoc|Any CPU.ActiveCfg = Release|Any CPU
|
||||
{428CACAB-CC26-4F41-9062-1E4A9BC82640}.Ad-Hoc|Any CPU.Build.0 = Release|Any CPU
|
||||
{428CACAB-CC26-4F41-9062-1E4A9BC82640}.Ad-Hoc|ARM.ActiveCfg = Release|Any CPU
|
||||
{428CACAB-CC26-4F41-9062-1E4A9BC82640}.Ad-Hoc|ARM.Build.0 = Release|Any CPU
|
||||
{428CACAB-CC26-4F41-9062-1E4A9BC82640}.Ad-Hoc|iPhone.ActiveCfg = Release|Any CPU
|
||||
{428CACAB-CC26-4F41-9062-1E4A9BC82640}.Ad-Hoc|iPhone.Build.0 = Release|Any CPU
|
||||
{428CACAB-CC26-4F41-9062-1E4A9BC82640}.Ad-Hoc|iPhoneSimulator.ActiveCfg = Release|Any CPU
|
||||
{428CACAB-CC26-4F41-9062-1E4A9BC82640}.Ad-Hoc|iPhoneSimulator.Build.0 = Release|Any CPU
|
||||
{428CACAB-CC26-4F41-9062-1E4A9BC82640}.Ad-Hoc|x64.ActiveCfg = Release|Any CPU
|
||||
{428CACAB-CC26-4F41-9062-1E4A9BC82640}.Ad-Hoc|x64.Build.0 = Release|Any CPU
|
||||
{428CACAB-CC26-4F41-9062-1E4A9BC82640}.Ad-Hoc|x86.ActiveCfg = Release|Any CPU
|
||||
{428CACAB-CC26-4F41-9062-1E4A9BC82640}.Ad-Hoc|x86.Build.0 = Release|Any CPU
|
||||
{428CACAB-CC26-4F41-9062-1E4A9BC82640}.AppStore|Any CPU.ActiveCfg = Release|Any CPU
|
||||
{428CACAB-CC26-4F41-9062-1E4A9BC82640}.AppStore|Any CPU.Build.0 = Release|Any CPU
|
||||
{428CACAB-CC26-4F41-9062-1E4A9BC82640}.AppStore|ARM.ActiveCfg = Release|Any CPU
|
||||
{428CACAB-CC26-4F41-9062-1E4A9BC82640}.AppStore|ARM.Build.0 = Release|Any CPU
|
||||
{428CACAB-CC26-4F41-9062-1E4A9BC82640}.AppStore|iPhone.ActiveCfg = Release|Any CPU
|
||||
{428CACAB-CC26-4F41-9062-1E4A9BC82640}.AppStore|iPhone.Build.0 = Release|Any CPU
|
||||
{428CACAB-CC26-4F41-9062-1E4A9BC82640}.AppStore|iPhoneSimulator.ActiveCfg = Release|Any CPU
|
||||
{428CACAB-CC26-4F41-9062-1E4A9BC82640}.AppStore|iPhoneSimulator.Build.0 = Release|Any CPU
|
||||
{428CACAB-CC26-4F41-9062-1E4A9BC82640}.AppStore|x64.ActiveCfg = Release|Any CPU
|
||||
{428CACAB-CC26-4F41-9062-1E4A9BC82640}.AppStore|x64.Build.0 = Release|Any CPU
|
||||
{428CACAB-CC26-4F41-9062-1E4A9BC82640}.AppStore|x86.ActiveCfg = Release|Any CPU
|
||||
{428CACAB-CC26-4F41-9062-1E4A9BC82640}.AppStore|x86.Build.0 = Release|Any CPU
|
||||
{428CACAB-CC26-4F41-9062-1E4A9BC82640}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
|
||||
{428CACAB-CC26-4F41-9062-1E4A9BC82640}.Debug|Any CPU.Build.0 = Debug|Any CPU
|
||||
{428CACAB-CC26-4F41-9062-1E4A9BC82640}.Debug|ARM.ActiveCfg = Debug|Any CPU
|
||||
{428CACAB-CC26-4F41-9062-1E4A9BC82640}.Debug|ARM.Build.0 = Debug|Any CPU
|
||||
{428CACAB-CC26-4F41-9062-1E4A9BC82640}.Debug|iPhone.ActiveCfg = Debug|Any CPU
|
||||
{428CACAB-CC26-4F41-9062-1E4A9BC82640}.Debug|iPhone.Build.0 = Debug|Any CPU
|
||||
{428CACAB-CC26-4F41-9062-1E4A9BC82640}.Debug|iPhoneSimulator.ActiveCfg = Debug|Any CPU
|
||||
{428CACAB-CC26-4F41-9062-1E4A9BC82640}.Debug|iPhoneSimulator.Build.0 = Debug|Any CPU
|
||||
{428CACAB-CC26-4F41-9062-1E4A9BC82640}.Debug|x64.ActiveCfg = Debug|Any CPU
|
||||
{428CACAB-CC26-4F41-9062-1E4A9BC82640}.Debug|x64.Build.0 = Debug|Any CPU
|
||||
{428CACAB-CC26-4F41-9062-1E4A9BC82640}.Debug|x86.ActiveCfg = Debug|Any CPU
|
||||
{428CACAB-CC26-4F41-9062-1E4A9BC82640}.Debug|x86.Build.0 = Debug|Any CPU
|
||||
{428CACAB-CC26-4F41-9062-1E4A9BC82640}.Release|Any CPU.ActiveCfg = Release|Any CPU
|
||||
{428CACAB-CC26-4F41-9062-1E4A9BC82640}.Release|Any CPU.Build.0 = Release|Any CPU
|
||||
{428CACAB-CC26-4F41-9062-1E4A9BC82640}.Release|ARM.ActiveCfg = Release|Any CPU
|
||||
{428CACAB-CC26-4F41-9062-1E4A9BC82640}.Release|ARM.Build.0 = Release|Any CPU
|
||||
{428CACAB-CC26-4F41-9062-1E4A9BC82640}.Release|iPhone.ActiveCfg = Release|Any CPU
|
||||
{428CACAB-CC26-4F41-9062-1E4A9BC82640}.Release|iPhone.Build.0 = Release|Any CPU
|
||||
{428CACAB-CC26-4F41-9062-1E4A9BC82640}.Release|iPhoneSimulator.ActiveCfg = Release|Any CPU
|
||||
{428CACAB-CC26-4F41-9062-1E4A9BC82640}.Release|iPhoneSimulator.Build.0 = Release|Any CPU
|
||||
{428CACAB-CC26-4F41-9062-1E4A9BC82640}.Release|x64.ActiveCfg = Release|Any CPU
|
||||
{428CACAB-CC26-4F41-9062-1E4A9BC82640}.Release|x64.Build.0 = Release|Any CPU
|
||||
{428CACAB-CC26-4F41-9062-1E4A9BC82640}.Release|x86.ActiveCfg = Release|Any CPU
|
||||
{428CACAB-CC26-4F41-9062-1E4A9BC82640}.Release|x86.Build.0 = Release|Any CPU
|
||||
EndGlobalSection
|
||||
GlobalSection(SolutionProperties) = preSolution
|
||||
HideSolutionNode = FALSE
|
||||
@@ -424,5 +478,7 @@ Global
|
||||
{B2538ADA-B605-4D6F-ACD2-62A409680F84} = {EC730FD9-F623-4B6C-B503-95CDCFBCF277}
|
||||
{6702027A-F726-4149-863E-7CB924674B9A} = {0D790714-ECF8-4A83-BE4A-E9C84DD1BB5D}
|
||||
{FA507A17-D4E3-46DF-ACD8-D7E6D7D4E3AE} = {0D790714-ECF8-4A83-BE4A-E9C84DD1BB5D}
|
||||
{2E399654-26A2-46F6-B9CA-1B496A3F370A} = {92470CBD-9047-4C3C-8EA3-D972D6622D84}
|
||||
{428CACAB-CC26-4F41-9062-1E4A9BC82640} = {2E399654-26A2-46F6-B9CA-1B496A3F370A}
|
||||
EndGlobalSection
|
||||
EndGlobal
|
||||
|
||||
BIN
src/Android/8bit.keystore.enc
Normal file
@@ -36,13 +36,17 @@
|
||||
<WarningLevel>4</WarningLevel>
|
||||
<AndroidUseSharedRuntime>True</AndroidUseSharedRuntime>
|
||||
<AndroidLinkMode>None</AndroidLinkMode>
|
||||
<AndroidLinkSkip>Xamarin.GooglePlayServices.Gcm;BitwardenAndroid;BitwardenApp;Microsoft.Practices.Unity;SQLite-net</AndroidLinkSkip>
|
||||
<AndroidLinkSkip>PushNotification.Plugin;PushNotification.Plugin.Abstractions;Xamarin.GooglePlayServices.Base;Xamarin.GooglePlayServices.Basement;Xamarin.GooglePlayServices.Measurement;Xamarin.GooglePlayServices.Gcm;BitwardenAndroid;BitwardenApp;Microsoft.Practices.Unity;SQLite-net;Xamarin.Android.Net</AndroidLinkSkip>
|
||||
<EmbedAssembliesIntoApk>True</EmbedAssembliesIntoApk>
|
||||
<BundleAssemblies>False</BundleAssemblies>
|
||||
<AndroidCreatePackagePerAbi>False</AndroidCreatePackagePerAbi>
|
||||
<Debugger>Xamarin</Debugger>
|
||||
<AndroidEnableMultiDex>False</AndroidEnableMultiDex>
|
||||
<JavaMaximumHeapSize>1G</JavaMaximumHeapSize>
|
||||
<AndroidHttpClientHandlerType>Xamarin.Android.Net.AndroidClientHandler</AndroidHttpClientHandlerType>
|
||||
<AotAssemblies>False</AotAssemblies>
|
||||
<EnableLLVM>False</EnableLLVM>
|
||||
<EnableProguard>False</EnableProguard>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
|
||||
<DebugType>pdbonly</DebugType>
|
||||
@@ -63,7 +67,8 @@
|
||||
<EnableProguard>False</EnableProguard>
|
||||
<DebugSymbols>False</DebugSymbols>
|
||||
<JavaMaximumHeapSize>1G</JavaMaximumHeapSize>
|
||||
<AndroidLinkSkip>PushNotification.Plugin;PushNotification.Plugin.Abstractions;Xamarin.GooglePlayServices.Base;Xamarin.GooglePlayServices.Basement;Xamarin.GooglePlayServices.Measurement;Xamarin.GooglePlayServices.Gcm;BitwardenAndroid;BitwardenApp;Microsoft.Practices.Unity;SQLite-net</AndroidLinkSkip>
|
||||
<AndroidLinkSkip>PushNotification.Plugin;PushNotification.Plugin.Abstractions;Xamarin.GooglePlayServices.Base;Xamarin.GooglePlayServices.Basement;Xamarin.GooglePlayServices.Measurement;Xamarin.GooglePlayServices.Gcm;BitwardenAndroid;BitwardenApp;Microsoft.Practices.Unity;SQLite-net;Xamarin.Android.Net</AndroidLinkSkip>
|
||||
<AndroidHttpClientHandlerType>Xamarin.Android.Net.AndroidClientHandler</AndroidHttpClientHandlerType>
|
||||
</PropertyGroup>
|
||||
<ItemGroup>
|
||||
<Reference Include="Acr.Support.Android, Version=1.0.0.0, Culture=neutral, processorArchitecture=MSIL">
|
||||
@@ -71,11 +76,11 @@
|
||||
<Private>True</Private>
|
||||
</Reference>
|
||||
<Reference Include="Acr.UserDialogs, Version=1.0.0.0, Culture=neutral, processorArchitecture=MSIL">
|
||||
<HintPath>..\..\packages\Acr.UserDialogs.6.0.1\lib\MonoAndroid10\Acr.UserDialogs.dll</HintPath>
|
||||
<HintPath>..\..\packages\Acr.UserDialogs.6.3.3\lib\MonoAndroid10\Acr.UserDialogs.dll</HintPath>
|
||||
<Private>True</Private>
|
||||
</Reference>
|
||||
<Reference Include="Acr.UserDialogs.Interface, Version=1.0.0.0, Culture=neutral, processorArchitecture=MSIL">
|
||||
<HintPath>..\..\packages\Acr.UserDialogs.6.0.1\lib\MonoAndroid10\Acr.UserDialogs.Interface.dll</HintPath>
|
||||
<HintPath>..\..\packages\Acr.UserDialogs.6.3.3\lib\MonoAndroid10\Acr.UserDialogs.Interface.dll</HintPath>
|
||||
<Private>True</Private>
|
||||
</Reference>
|
||||
<Reference Include="AndHUD, Version=1.2.0.0, Culture=neutral, processorArchitecture=MSIL">
|
||||
@@ -87,15 +92,15 @@
|
||||
<Private>True</Private>
|
||||
</Reference>
|
||||
<Reference Include="FormsViewGroup, Version=2.0.0.0, Culture=neutral, processorArchitecture=MSIL">
|
||||
<HintPath>..\..\packages\Xamarin.Forms.2.3.2.127\lib\MonoAndroid10\FormsViewGroup.dll</HintPath>
|
||||
<HintPath>..\..\packages\Xamarin.Forms.2.3.3.180\lib\MonoAndroid10\FormsViewGroup.dll</HintPath>
|
||||
<Private>True</Private>
|
||||
</Reference>
|
||||
<Reference Include="HockeySDK, Version=1.0.0.0, Culture=neutral, processorArchitecture=MSIL">
|
||||
<HintPath>..\..\packages\HockeySDK.Xamarin.4.1.0-beta3\lib\MonoAndroid403\HockeySDK.dll</HintPath>
|
||||
<HintPath>..\..\packages\HockeySDK.Xamarin.4.1.0\lib\MonoAndroid403\HockeySDK.dll</HintPath>
|
||||
<Private>True</Private>
|
||||
</Reference>
|
||||
<Reference Include="HockeySDK.AndroidBindings, Version=1.0.0.0, Culture=neutral, processorArchitecture=MSIL">
|
||||
<HintPath>..\..\packages\HockeySDK.Xamarin.4.1.0-beta3\lib\MonoAndroid403\HockeySDK.AndroidBindings.dll</HintPath>
|
||||
<HintPath>..\..\packages\HockeySDK.Xamarin.4.1.0\lib\MonoAndroid403\HockeySDK.AndroidBindings.dll</HintPath>
|
||||
<Private>True</Private>
|
||||
</Reference>
|
||||
<Reference Include="Microsoft.Practices.ServiceLocation, Version=1.3.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35, processorArchitecture=MSIL">
|
||||
@@ -106,38 +111,30 @@
|
||||
<HintPath>..\..\packages\Unity.3.5.1405-prerelease\lib\portable-net45+wp80+win8+wpa81+MonoAndroid10+MonoTouch10\Microsoft.Practices.Unity.dll</HintPath>
|
||||
<Private>True</Private>
|
||||
</Reference>
|
||||
<Reference Include="ModernHttpClient, Version=2.4.2.0, Culture=neutral, processorArchitecture=MSIL">
|
||||
<HintPath>..\..\packages\modernhttpclient.2.4.2\lib\MonoAndroid\ModernHttpClient.dll</HintPath>
|
||||
<Private>True</Private>
|
||||
</Reference>
|
||||
<Reference Include="Mono.Android" />
|
||||
<Reference Include="mscorlib" />
|
||||
<Reference Include="Newtonsoft.Json, Version=9.0.0.0, Culture=neutral, PublicKeyToken=30ad4fe6b2a6aeed, processorArchitecture=MSIL">
|
||||
<HintPath>..\..\packages\Newtonsoft.Json.9.0.1\lib\portable-net45+wp80+win8+wpa81\Newtonsoft.Json.dll</HintPath>
|
||||
<Private>True</Private>
|
||||
</Reference>
|
||||
<Reference Include="OkHttp, Version=1.0.0.0, Culture=neutral, processorArchitecture=MSIL">
|
||||
<HintPath>..\..\packages\modernhttpclient.2.4.2\lib\MonoAndroid\OkHttp.dll</HintPath>
|
||||
<Private>True</Private>
|
||||
</Reference>
|
||||
<Reference Include="PCLCrypto, Version=2.0.0.0, Culture=neutral, PublicKeyToken=d4421c8a4786956c, processorArchitecture=MSIL">
|
||||
<HintPath>..\..\packages\PCLCrypto.2.0.147\lib\MonoAndroid23\PCLCrypto.dll</HintPath>
|
||||
<Private>True</Private>
|
||||
</Reference>
|
||||
<Reference Include="PInvoke.BCrypt, Version=0.3.0.0, Culture=neutral, PublicKeyToken=9e300f9f87f04a7a, processorArchitecture=MSIL">
|
||||
<HintPath>..\..\packages\PInvoke.BCrypt.0.3.2\lib\portable-net45+win+wpa81+MonoAndroid10+xamarinios10+MonoTouch10\PInvoke.BCrypt.dll</HintPath>
|
||||
<HintPath>..\..\packages\PInvoke.BCrypt.0.3.152\lib\portable-net45+win+wpa81+MonoAndroid10+xamarinios10+MonoTouch10\PInvoke.BCrypt.dll</HintPath>
|
||||
<Private>True</Private>
|
||||
</Reference>
|
||||
<Reference Include="PInvoke.Kernel32, Version=0.3.0.0, Culture=neutral, PublicKeyToken=9e300f9f87f04a7a, processorArchitecture=MSIL">
|
||||
<HintPath>..\..\packages\PInvoke.Kernel32.0.3.2\lib\portable-net45+win+wpa81+MonoAndroid10+xamarinios10+MonoTouch10\PInvoke.Kernel32.dll</HintPath>
|
||||
<HintPath>..\..\packages\PInvoke.Kernel32.0.3.152\lib\portable-net45+win+wpa81+MonoAndroid10+xamarinios10+MonoTouch10\PInvoke.Kernel32.dll</HintPath>
|
||||
<Private>True</Private>
|
||||
</Reference>
|
||||
<Reference Include="PInvoke.NCrypt, Version=0.3.0.0, Culture=neutral, PublicKeyToken=9e300f9f87f04a7a, processorArchitecture=MSIL">
|
||||
<HintPath>..\..\packages\PInvoke.NCrypt.0.3.2\lib\portable-net45+win+wpa81+MonoAndroid10+xamarinios10+MonoTouch10\PInvoke.NCrypt.dll</HintPath>
|
||||
<HintPath>..\..\packages\PInvoke.NCrypt.0.3.152\lib\portable-net45+win+wpa81+MonoAndroid10+xamarinios10+MonoTouch10\PInvoke.NCrypt.dll</HintPath>
|
||||
<Private>True</Private>
|
||||
</Reference>
|
||||
<Reference Include="PInvoke.Windows.Core, Version=0.3.0.0, Culture=neutral, PublicKeyToken=9e300f9f87f04a7a, processorArchitecture=MSIL">
|
||||
<HintPath>..\..\packages\PInvoke.Windows.Core.0.3.2\lib\portable-net45+win+wpa81+MonoAndroid10+xamarinios10+MonoTouch10\PInvoke.Windows.Core.dll</HintPath>
|
||||
<HintPath>..\..\packages\PInvoke.Windows.Core.0.3.152\lib\portable-net45+win+wpa81+MonoAndroid10+xamarinios10+MonoTouch10\PInvoke.Windows.Core.dll</HintPath>
|
||||
<Private>True</Private>
|
||||
</Reference>
|
||||
<Reference Include="Plugin.Connectivity, Version=2.2.12.0, Culture=neutral, processorArchitecture=MSIL">
|
||||
@@ -160,20 +157,20 @@
|
||||
<HintPath>..\..\packages\Plugin.Fingerprint.1.2.0\lib\MonoAndroid\Plugin.Fingerprint.Abstractions.dll</HintPath>
|
||||
<Private>True</Private>
|
||||
</Reference>
|
||||
<Reference Include="Plugin.Settings, Version=2.1.0.0, Culture=neutral, processorArchitecture=MSIL">
|
||||
<HintPath>..\..\packages\Xam.Plugins.Settings.2.1.0\lib\MonoAndroid10\Plugin.Settings.dll</HintPath>
|
||||
<Reference Include="Plugin.Settings, Version=2.5.1.0, Culture=neutral, processorArchitecture=MSIL">
|
||||
<HintPath>..\..\packages\Xam.Plugins.Settings.2.5.1.0\lib\MonoAndroid10\Plugin.Settings.dll</HintPath>
|
||||
<Private>True</Private>
|
||||
</Reference>
|
||||
<Reference Include="Plugin.Settings.Abstractions, Version=2.1.0.0, Culture=neutral, processorArchitecture=MSIL">
|
||||
<HintPath>..\..\packages\Xam.Plugins.Settings.2.1.0\lib\MonoAndroid10\Plugin.Settings.Abstractions.dll</HintPath>
|
||||
<Reference Include="Plugin.Settings.Abstractions, Version=2.5.1.0, Culture=neutral, processorArchitecture=MSIL">
|
||||
<HintPath>..\..\packages\Xam.Plugins.Settings.2.5.1.0\lib\MonoAndroid10\Plugin.Settings.Abstractions.dll</HintPath>
|
||||
<Private>True</Private>
|
||||
</Reference>
|
||||
<Reference Include="PushNotification.Plugin, Version=1.0.0.0, Culture=neutral, processorArchitecture=MSIL">
|
||||
<HintPath>..\..\packages\Xam.Plugin.PushNotification.1.2.2\lib\MonoAndroid10\PushNotification.Plugin.dll</HintPath>
|
||||
<HintPath>..\..\packages\Xam.Plugin.PushNotification.1.2.4\lib\MonoAndroid10\PushNotification.Plugin.dll</HintPath>
|
||||
<Private>True</Private>
|
||||
</Reference>
|
||||
<Reference Include="PushNotification.Plugin.Abstractions, Version=1.0.0.0, Culture=neutral, processorArchitecture=MSIL">
|
||||
<HintPath>..\..\packages\Xam.Plugin.PushNotification.1.2.2\lib\MonoAndroid10\PushNotification.Plugin.Abstractions.dll</HintPath>
|
||||
<HintPath>..\..\packages\Xam.Plugin.PushNotification.1.2.4\lib\MonoAndroid10\PushNotification.Plugin.Abstractions.dll</HintPath>
|
||||
<Private>True</Private>
|
||||
</Reference>
|
||||
<Reference Include="Splat, Version=1.6.2.0, Culture=neutral, processorArchitecture=MSIL">
|
||||
@@ -181,7 +178,7 @@
|
||||
<Private>True</Private>
|
||||
</Reference>
|
||||
<Reference Include="SQLite-net, Version=1.1.0.0, Culture=neutral, processorArchitecture=MSIL">
|
||||
<HintPath>..\..\packages\sqlite-net-pcl.1.1.2\lib\portable-net45+wp8+wpa81+win8+MonoAndroid10+MonoTouch10+Xamarin.iOS10\SQLite-net.dll</HintPath>
|
||||
<HintPath>..\..\packages\sqlite-net-pcl.1.2.1\lib\portable-net45+wp8+wpa81+win8+MonoAndroid10+MonoTouch10+Xamarin.iOS10\SQLite-net.dll</HintPath>
|
||||
<Private>True</Private>
|
||||
</Reference>
|
||||
<Reference Include="SQLitePCL.batteries, Version=0.0.0.0, Culture=neutral, processorArchitecture=MSIL">
|
||||
@@ -196,10 +193,31 @@
|
||||
<HintPath>..\..\packages\SQLitePCL.plugin.sqlite3.android.0.9.3\lib\MonoAndroid\SQLitePCLPlugin_esqlite3.dll</HintPath>
|
||||
<Private>True</Private>
|
||||
</Reference>
|
||||
<Reference Include="SQLitePCLRaw.batteries_green, Version=1.0.0.0, Culture=neutral, PublicKeyToken=a84b7dcfb1391f7f, processorArchitecture=MSIL">
|
||||
<HintPath>..\..\packages\SQLitePCLRaw.bundle_green.1.1.2\lib\MonoAndroid\SQLitePCLRaw.batteries_green.dll</HintPath>
|
||||
<Private>True</Private>
|
||||
</Reference>
|
||||
<Reference Include="SQLitePCLRaw.batteries_v2, Version=1.0.0.0, Culture=neutral, PublicKeyToken=8226ea5df37bcae9, processorArchitecture=MSIL">
|
||||
<HintPath>..\..\packages\SQLitePCLRaw.bundle_green.1.1.2\lib\MonoAndroid\SQLitePCLRaw.batteries_v2.dll</HintPath>
|
||||
<Private>True</Private>
|
||||
</Reference>
|
||||
<Reference Include="SQLitePCLRaw.core, Version=1.0.0.0, Culture=neutral, PublicKeyToken=1488e028ca7ab535, processorArchitecture=MSIL">
|
||||
<HintPath>..\..\packages\SQLitePCLRaw.core.1.1.2\lib\MonoAndroid\SQLitePCLRaw.core.dll</HintPath>
|
||||
<Private>True</Private>
|
||||
</Reference>
|
||||
<Reference Include="SQLitePCLRaw.lib.e_sqlite3, Version=1.0.0.0, Culture=neutral, PublicKeyToken=e4ad490600e2234c, processorArchitecture=MSIL">
|
||||
<HintPath>..\..\packages\SQLitePCLRaw.lib.e_sqlite3.android.1.1.2\lib\MonoAndroid\SQLitePCLRaw.lib.e_sqlite3.dll</HintPath>
|
||||
<Private>True</Private>
|
||||
</Reference>
|
||||
<Reference Include="SQLitePCLRaw.provider.e_sqlite3, Version=1.0.0.0, Culture=neutral, PublicKeyToken=9c301db686d0bd12, processorArchitecture=MSIL">
|
||||
<HintPath>..\..\packages\SQLitePCLRaw.provider.e_sqlite3.android.1.1.2\lib\MonoAndroid\SQLitePCLRaw.provider.e_sqlite3.dll</HintPath>
|
||||
<Private>True</Private>
|
||||
</Reference>
|
||||
<Reference Include="System" />
|
||||
<Reference Include="System.Core" />
|
||||
<Reference Include="Validation, Version=2.2.0.0, Culture=neutral, PublicKeyToken=2fc06f0d701809a7, processorArchitecture=MSIL">
|
||||
<HintPath>..\..\packages\Validation.2.2.8\lib\dotnet\Validation.dll</HintPath>
|
||||
<Reference Include="System.Net.Http" />
|
||||
<Reference Include="Validation, Version=2.3.0.0, Culture=neutral, PublicKeyToken=2fc06f0d701809a7, processorArchitecture=MSIL">
|
||||
<HintPath>..\..\packages\Validation.2.3.7\lib\dotnet\Validation.dll</HintPath>
|
||||
<Private>True</Private>
|
||||
</Reference>
|
||||
<Reference Include="Xamarin.Android.Support.Animated.Vector.Drawable, Version=1.0.0.0, Culture=neutral, processorArchitecture=MSIL">
|
||||
@@ -235,19 +253,19 @@
|
||||
<Private>True</Private>
|
||||
</Reference>
|
||||
<Reference Include="Xamarin.Forms.Core, Version=2.0.0.0, Culture=neutral, processorArchitecture=MSIL">
|
||||
<HintPath>..\..\packages\Xamarin.Forms.2.3.2.127\lib\MonoAndroid10\Xamarin.Forms.Core.dll</HintPath>
|
||||
<HintPath>..\..\packages\Xamarin.Forms.2.3.3.180\lib\MonoAndroid10\Xamarin.Forms.Core.dll</HintPath>
|
||||
<Private>True</Private>
|
||||
</Reference>
|
||||
<Reference Include="Xamarin.Forms.Platform, Version=1.0.0.0, Culture=neutral, processorArchitecture=MSIL">
|
||||
<HintPath>..\..\packages\Xamarin.Forms.2.3.2.127\lib\MonoAndroid10\Xamarin.Forms.Platform.dll</HintPath>
|
||||
<HintPath>..\..\packages\Xamarin.Forms.2.3.3.180\lib\MonoAndroid10\Xamarin.Forms.Platform.dll</HintPath>
|
||||
<Private>True</Private>
|
||||
</Reference>
|
||||
<Reference Include="Xamarin.Forms.Platform.Android, Version=2.0.0.0, Culture=neutral, processorArchitecture=MSIL">
|
||||
<HintPath>..\..\packages\Xamarin.Forms.2.3.2.127\lib\MonoAndroid10\Xamarin.Forms.Platform.Android.dll</HintPath>
|
||||
<HintPath>..\..\packages\Xamarin.Forms.2.3.3.180\lib\MonoAndroid10\Xamarin.Forms.Platform.Android.dll</HintPath>
|
||||
<Private>True</Private>
|
||||
</Reference>
|
||||
<Reference Include="Xamarin.Forms.Xaml, Version=2.0.0.0, Culture=neutral, processorArchitecture=MSIL">
|
||||
<HintPath>..\..\packages\Xamarin.Forms.2.3.2.127\lib\MonoAndroid10\Xamarin.Forms.Xaml.dll</HintPath>
|
||||
<HintPath>..\..\packages\Xamarin.Forms.2.3.3.180\lib\MonoAndroid10\Xamarin.Forms.Xaml.dll</HintPath>
|
||||
<Private>True</Private>
|
||||
</Reference>
|
||||
<Reference Include="Xamarin.GooglePlayServices.Analytics, Version=1.0.0.0, Culture=neutral, processorArchitecture=MSIL">
|
||||
@@ -280,11 +298,14 @@
|
||||
</Reference>
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<Compile Include="AutofillActivity.cs" />
|
||||
<Compile Include="AutofillCredentials.cs" />
|
||||
<Compile Include="Controls\CustomSearchBarRenderer.cs" />
|
||||
<Compile Include="Controls\CustomButtonRenderer.cs" />
|
||||
<Compile Include="Controls\ExtendedButtonRenderer.cs" />
|
||||
<Compile Include="Controls\ExtendedTabbedPageRenderer.cs" />
|
||||
<Compile Include="Controls\ExtendedTableViewRenderer.cs" />
|
||||
<Compile Include="CustomAndroidClientHandler.cs" />
|
||||
<Compile Include="HockeyAppCrashManagerListener.cs" />
|
||||
<Compile Include="AutofillService.cs" />
|
||||
<Compile Include="Controls\ExtendedEditorRenderer.cs" />
|
||||
@@ -293,6 +314,8 @@
|
||||
<Compile Include="Controls\ExtendedTextCellRenderer.cs" />
|
||||
<Compile Include="Controls\ExtendedPickerRenderer.cs" />
|
||||
<Compile Include="Controls\ExtendedEntryRenderer.cs" />
|
||||
<Compile Include="Services\HttpService.cs" />
|
||||
<Compile Include="Services\LocalizeService.cs" />
|
||||
<Compile Include="MainApplication.cs" />
|
||||
<Compile Include="Resources\Resource.Designer.cs" />
|
||||
<Compile Include="Services\DeviceInfoService.cs" />
|
||||
@@ -303,12 +326,17 @@
|
||||
<Compile Include="Services\KeyStoreStorageService.cs" />
|
||||
<Compile Include="MainActivity.cs" />
|
||||
<Compile Include="Properties\AssemblyInfo.cs" />
|
||||
<Compile Include="Services\LogService.cs" />
|
||||
<Compile Include="Services\ReflectionService.cs" />
|
||||
<Compile Include="Services\SqlService.cs" />
|
||||
<Compile Include="SplashActivity.cs" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<None Include="app.config" />
|
||||
<None Include="8bit.keystore.enc" />
|
||||
<None Include="app.config">
|
||||
<SubType>Designer</SubType>
|
||||
</None>
|
||||
<None Include="increment-version.ps1" />
|
||||
<None Include="packages.config">
|
||||
<SubType>Designer</SubType>
|
||||
</None>
|
||||
@@ -717,6 +745,90 @@
|
||||
<ItemGroup>
|
||||
<AndroidResource Include="Resources\drawable\icon.png" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<AndroidEnvironment Include="EnvironmentVariables.txt" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<AndroidResource Include="Resources\drawable\notification_sm.png" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<AndroidResource Include="Resources\drawable-hdpi\notification_sm.png" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<AndroidResource Include="Resources\drawable-xhdpi\notification_sm.png" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<AndroidResource Include="Resources\drawable-xxhdpi\notification_sm.png" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<AndroidResource Include="Resources\drawable-xxxhdpi\notification_sm.png" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<AndroidResource Include="Resources\drawable\accessibility_step1.png" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<AndroidResource Include="Resources\drawable\accessibility_step2.png" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<AndroidResource Include="Resources\drawable-xxhdpi\accessibility_step1.png" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<AndroidResource Include="Resources\drawable-xhdpi\accessibility_step1.png" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<AndroidResource Include="Resources\drawable-hdpi\accessibility_step1.png" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<AndroidResource Include="Resources\drawable-xxhdpi\accessibility_step2.png" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<AndroidResource Include="Resources\drawable-xhdpi\accessibility_step2.png" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<AndroidResource Include="Resources\drawable-hdpi\accessibility_step2.png" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<AndroidResource Include="Resources\drawable-xxhdpi\accessibility_notification.png" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<AndroidResource Include="Resources\drawable-xhdpi\accessibility_notification.png" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<AndroidResource Include="Resources\drawable-hdpi\accessibility_notification.png" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<AndroidResource Include="Resources\drawable\accessibility_notification.png" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<AndroidResource Include="Resources\drawable-xxhdpi\accessibility_notification_icon.png" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<AndroidResource Include="Resources\drawable-xhdpi\accessibility_notification_icon.png" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<AndroidResource Include="Resources\drawable-hdpi\accessibility_notification_icon.png" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<AndroidResource Include="Resources\drawable\accessibility_notification_icon.png" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<AndroidResource Include="Resources\values\strings.xml" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<AndroidResource Include="Resources\drawable-xxxhdpi\close.png" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<AndroidResource Include="Resources\drawable-xxhdpi\close.png" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<AndroidResource Include="Resources\drawable-xhdpi\close.png" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<AndroidResource Include="Resources\drawable-hdpi\close.png" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<AndroidResource Include="Resources\drawable\close.png" />
|
||||
</ItemGroup>
|
||||
<Import Project="$(MSBuildExtensionsPath)\Xamarin\Android\Xamarin.Android.CSharp.targets" />
|
||||
<Import Project="..\..\packages\Xamarin.Android.Support.Vector.Drawable.23.3.0\build\Xamarin.Android.Support.Vector.Drawable.targets" Condition="Exists('..\..\packages\Xamarin.Android.Support.Vector.Drawable.23.3.0\build\Xamarin.Android.Support.Vector.Drawable.targets')" />
|
||||
<Target Name="EnsureNuGetPackageBuildImports" BeforeTargets="PrepareForBuild">
|
||||
@@ -725,10 +837,10 @@
|
||||
</PropertyGroup>
|
||||
<Error Condition="!Exists('..\..\packages\Xamarin.Android.Support.Vector.Drawable.23.3.0\build\Xamarin.Android.Support.Vector.Drawable.targets')" Text="$([System.String]::Format('$(ErrorText)', '..\..\packages\Xamarin.Android.Support.Vector.Drawable.23.3.0\build\Xamarin.Android.Support.Vector.Drawable.targets'))" />
|
||||
<Error Condition="!Exists('..\..\packages\Xamarin.GooglePlayServices.Basement.29.0.0.2\build\Xamarin.GooglePlayServices.Basement.targets')" Text="$([System.String]::Format('$(ErrorText)', '..\..\packages\Xamarin.GooglePlayServices.Basement.29.0.0.2\build\Xamarin.GooglePlayServices.Basement.targets'))" />
|
||||
<Error Condition="!Exists('..\..\packages\Xamarin.Forms.2.3.2.127\build\portable-win+net45+wp80+win81+wpa81+MonoAndroid10+MonoTouch10+Xamarin.iOS10\Xamarin.Forms.targets')" Text="$([System.String]::Format('$(ErrorText)', '..\..\packages\Xamarin.Forms.2.3.2.127\build\portable-win+net45+wp80+win81+wpa81+MonoAndroid10+MonoTouch10+Xamarin.iOS10\Xamarin.Forms.targets'))" />
|
||||
<Error Condition="!Exists('..\..\packages\Xamarin.Forms.2.3.3.180\build\portable-win+net45+wp80+win81+wpa81+MonoAndroid10+Xamarin.iOS10+xamarinmac20\Xamarin.Forms.targets')" Text="$([System.String]::Format('$(ErrorText)', '..\..\packages\Xamarin.Forms.2.3.3.180\build\portable-win+net45+wp80+win81+wpa81+MonoAndroid10+Xamarin.iOS10+xamarinmac20\Xamarin.Forms.targets'))" />
|
||||
</Target>
|
||||
<Import Project="..\..\packages\Xamarin.GooglePlayServices.Basement.29.0.0.2\build\Xamarin.GooglePlayServices.Basement.targets" Condition="Exists('..\..\packages\Xamarin.GooglePlayServices.Basement.29.0.0.2\build\Xamarin.GooglePlayServices.Basement.targets')" />
|
||||
<Import Project="..\..\packages\Xamarin.Forms.2.3.2.127\build\portable-win+net45+wp80+win81+wpa81+MonoAndroid10+MonoTouch10+Xamarin.iOS10\Xamarin.Forms.targets" Condition="Exists('..\..\packages\Xamarin.Forms.2.3.2.127\build\portable-win+net45+wp80+win81+wpa81+MonoAndroid10+MonoTouch10+Xamarin.iOS10\Xamarin.Forms.targets')" />
|
||||
<Import Project="..\..\packages\Xamarin.Forms.2.3.3.180\build\portable-win+net45+wp80+win81+wpa81+MonoAndroid10+Xamarin.iOS10+xamarinmac20\Xamarin.Forms.targets" Condition="Exists('..\..\packages\Xamarin.Forms.2.3.3.180\build\portable-win+net45+wp80+win81+wpa81+MonoAndroid10+Xamarin.iOS10+xamarinmac20\Xamarin.Forms.targets')" />
|
||||
<!-- To modify your build process, add your task inside one of the targets below and uncomment it.
|
||||
Other similar extension points exist, see Microsoft.Common.targets.
|
||||
<Target Name="BeforeBuild">
|
||||
|
||||
102
src/Android/AutofillActivity.cs
Normal file
@@ -0,0 +1,102 @@
|
||||
using Android.App;
|
||||
using Android.Content;
|
||||
using Android.OS;
|
||||
using Android.Runtime;
|
||||
using Android.Views;
|
||||
|
||||
namespace Bit.Android
|
||||
{
|
||||
[Activity(Theme = "@style/BitwardenTheme.Splash",
|
||||
Label = "bitwarden",
|
||||
Icon = "@drawable/icon",
|
||||
WindowSoftInputMode = SoftInput.StateHidden)]
|
||||
public class AutofillActivity : Activity
|
||||
{
|
||||
private string _lastQueriedUri;
|
||||
|
||||
public static AutofillCredentials LastCredentials { get; set; }
|
||||
|
||||
protected override void OnCreate(Bundle bundle)
|
||||
{
|
||||
base.OnCreate(bundle);
|
||||
LaunchMainActivity(Intent, 932473);
|
||||
}
|
||||
|
||||
protected override void OnNewIntent(Intent intent)
|
||||
{
|
||||
base.OnNewIntent(intent);
|
||||
LaunchMainActivity(intent, 489729);
|
||||
}
|
||||
|
||||
protected override void OnDestroy()
|
||||
{
|
||||
base.OnDestroy();
|
||||
}
|
||||
|
||||
protected override void OnResume()
|
||||
{
|
||||
base.OnResume();
|
||||
if(!Intent.HasExtra("uri"))
|
||||
{
|
||||
Finish();
|
||||
return;
|
||||
}
|
||||
|
||||
Intent.RemoveExtra("uri");
|
||||
}
|
||||
|
||||
protected override void OnActivityResult(int requestCode, [GeneratedEnum] Result resultCode, Intent data)
|
||||
{
|
||||
base.OnActivityResult(requestCode, resultCode, data);
|
||||
if(data == null)
|
||||
{
|
||||
LastCredentials = null;
|
||||
}
|
||||
else
|
||||
{
|
||||
try
|
||||
{
|
||||
if(data.GetStringExtra("canceled") != null)
|
||||
{
|
||||
LastCredentials = null;
|
||||
}
|
||||
else
|
||||
{
|
||||
var uri = data.GetStringExtra("uri");
|
||||
var username = data.GetStringExtra("username");
|
||||
var password = data.GetStringExtra("password");
|
||||
|
||||
LastCredentials = new AutofillCredentials
|
||||
{
|
||||
Username = username,
|
||||
Password = password,
|
||||
Uri = uri,
|
||||
LastUri = _lastQueriedUri
|
||||
};
|
||||
}
|
||||
}
|
||||
catch
|
||||
{
|
||||
LastCredentials = null;
|
||||
}
|
||||
}
|
||||
|
||||
Finish();
|
||||
}
|
||||
|
||||
private void LaunchMainActivity(Intent callingIntent, int requestCode)
|
||||
{
|
||||
_lastQueriedUri = callingIntent?.GetStringExtra("uri");
|
||||
if(_lastQueriedUri == null)
|
||||
{
|
||||
Finish();
|
||||
return;
|
||||
}
|
||||
|
||||
var intent = new Intent(this, typeof(MainActivity));
|
||||
intent.PutExtra("uri", _lastQueriedUri);
|
||||
intent.PutExtra("ts", Java.Lang.JavaSystem.CurrentTimeMillis());
|
||||
StartActivityForResult(intent, requestCode);
|
||||
}
|
||||
}
|
||||
}
|
||||
10
src/Android/AutofillCredentials.cs
Normal file
@@ -0,0 +1,10 @@
|
||||
namespace Bit.Android
|
||||
{
|
||||
public class AutofillCredentials
|
||||
{
|
||||
public string Username { get; set; }
|
||||
public string Password { get; set; }
|
||||
public string Uri { get; set; }
|
||||
public string LastUri { get; set; }
|
||||
}
|
||||
}
|
||||
@@ -1,35 +1,104 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using Android.AccessibilityServices;
|
||||
using Android.App;
|
||||
using Android.Content;
|
||||
using Android.Graphics;
|
||||
using Android.OS;
|
||||
using Android.Runtime;
|
||||
using Android.Views;
|
||||
using Android.Views.Accessibility;
|
||||
using Android.Widget;
|
||||
|
||||
namespace Bit.Android
|
||||
{
|
||||
//[Service(Permission = "android.permission.BIND_ACCESSIBILITY_SERVICE", Label = "bitwarden")]
|
||||
//[IntentFilter(new string[] { "android.accessibilityservice.AccessibilityService" })]
|
||||
//[MetaData("android.accessibilityservice", Resource = "@xml/accessibilityservice")]
|
||||
[Service(Permission = "android.permission.BIND_ACCESSIBILITY_SERVICE", Label = "bitwarden")]
|
||||
[IntentFilter(new string[] { "android.accessibilityservice.AccessibilityService" })]
|
||||
[MetaData("android.accessibilityservice", Resource = "@xml/accessibilityservice")]
|
||||
public class AutofillService : AccessibilityService
|
||||
{
|
||||
private const int AutoFillNotificationId = 34573;
|
||||
private const string SystemUiPackage = "com.android.systemui";
|
||||
private const string BitwardenPackage = "com.x8bit.bitwarden";
|
||||
private const string BitwardenWebsite = "bitwarden.com";
|
||||
|
||||
public static bool Enabled { get; set; } = false;
|
||||
private static Dictionary<string, string[]> BrowserPackages => new Dictionary<string, string[]>
|
||||
{
|
||||
{ "com.android.chrome", new string[] { "url_bar" } },
|
||||
{ "com.chrome.beta", new string[] { "url_bar" } },
|
||||
{ "com.android.browser", new string[] { "url" } },
|
||||
{ "com.brave.browser", new string[] { "url_bar" } },
|
||||
{ "com.opera.browser", new string[] { "url_field" } },
|
||||
{ "com.opera.browser.beta", new string[] { "url_field" } },
|
||||
{ "com.opera.mini.native", new string[] { "url_field" } },
|
||||
{ "com.chrome.dev", new string[] { "url_bar" } },
|
||||
{ "com.chrome.canary", new string[] { "url_bar" } },
|
||||
{ "com.google.android.apps.chrome", new string[] { "url_bar" } },
|
||||
{ "com.google.android.apps.chrome_dev", new string[] { "url_bar" } },
|
||||
{ "org.iron.srware", new string[] { "url_bar" } },
|
||||
{ "com.sec.android.app.sbrowser", new string[] { "sbrowser_url_bar" } },
|
||||
{ "com.yandex.browser", new string[] { "bro_common_omnibox_host", "bro_common_omnibox_edit_text" } },
|
||||
{ "org.mozilla.firefox", new string[] { "url_bar_title" } },
|
||||
{ "org.mozilla.firefox_beta", new string[] { "url_bar_title" } },
|
||||
{ "com.ghostery.android.ghostery",new string[] { "search_field" } },
|
||||
{ "org.adblockplus.browser", new string[] { "url_bar_title" } },
|
||||
{ "com.htc.sense.browser", new string[] { "title" } },
|
||||
{ "com.amazon.cloud9", new string[] { "url" } },
|
||||
{ "mobi.mgeek.TunnyBrowser", new string[] { "title" } },
|
||||
{ "com.nubelacorp.javelin", new string[] { "enterUrl" } },
|
||||
{ "com.jerky.browser2", new string[] { "enterUrl" } },
|
||||
{ "com.mx.browser", new string[] { "address_editor_with_progress" } },
|
||||
{ "com.mx.browser.tablet", new string[] { "address_editor_with_progress"} },
|
||||
{ "com.linkbubble.playstore", new string[] { "url_text" }}
|
||||
};
|
||||
|
||||
public override void OnAccessibilityEvent(AccessibilityEvent e)
|
||||
{
|
||||
var eventType = e.EventType;
|
||||
switch(eventType)
|
||||
Enabled = true;
|
||||
var root = RootInActiveWindow;
|
||||
if(string.IsNullOrWhiteSpace(e.PackageName) || e.PackageName == SystemUiPackage ||
|
||||
root?.PackageName != e.PackageName)
|
||||
{
|
||||
case EventTypes.ViewTextSelectionChanged:
|
||||
if(e.Source.Password && string.IsNullOrWhiteSpace(e.Source.Text))
|
||||
return;
|
||||
}
|
||||
|
||||
switch(e.EventType)
|
||||
{
|
||||
case EventTypes.WindowContentChanged:
|
||||
case EventTypes.WindowStateChanged:
|
||||
var cancelNotification = true;
|
||||
|
||||
if(e.PackageName == BitwardenPackage)
|
||||
{
|
||||
var bundle = new Bundle();
|
||||
bundle.PutCharSequence(AccessibilityNodeInfo.ActionArgumentSetTextCharsequence, "mypassword");
|
||||
e.Source.PerformAction(global::Android.Views.Accessibility.Action.SetText, bundle);
|
||||
CancelNotification();
|
||||
break;
|
||||
}
|
||||
|
||||
var passwordNodes = GetWindowNodes(root, e, n => n.Password);
|
||||
if(passwordNodes.Any())
|
||||
{
|
||||
var uri = GetUri(root);
|
||||
if(uri.Contains(BitwardenWebsite))
|
||||
{
|
||||
break;
|
||||
}
|
||||
|
||||
if(NeedToAutofill(AutofillActivity.LastCredentials, uri))
|
||||
{
|
||||
var allEditTexts = GetWindowNodes(root, e, n => EditText(n));
|
||||
var usernameEditText = allEditTexts.TakeWhile(n => !n.Password).LastOrDefault();
|
||||
FillCredentials(usernameEditText, passwordNodes);
|
||||
}
|
||||
else
|
||||
{
|
||||
NotifyToAutofill(uri);
|
||||
cancelNotification = false;
|
||||
}
|
||||
|
||||
AutofillActivity.LastCredentials = null;
|
||||
}
|
||||
|
||||
if(cancelNotification)
|
||||
{
|
||||
CancelNotification();
|
||||
}
|
||||
break;
|
||||
default:
|
||||
@@ -41,5 +110,164 @@ namespace Bit.Android
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
protected override void OnServiceConnected()
|
||||
{
|
||||
base.OnServiceConnected();
|
||||
Enabled = true;
|
||||
}
|
||||
|
||||
public override void OnDestroy()
|
||||
{
|
||||
base.OnDestroy();
|
||||
Enabled = false;
|
||||
}
|
||||
|
||||
private void CancelNotification()
|
||||
{
|
||||
var notificationManager = ((NotificationManager)GetSystemService(NotificationService));
|
||||
notificationManager.Cancel(AutoFillNotificationId);
|
||||
}
|
||||
|
||||
private string GetUri(AccessibilityNodeInfo root)
|
||||
{
|
||||
var uri = string.Concat(App.Constants.AndroidAppProtocol, root.PackageName);
|
||||
if(BrowserPackages.ContainsKey(root.PackageName))
|
||||
{
|
||||
foreach(var addressViewId in BrowserPackages[root.PackageName])
|
||||
{
|
||||
var addressNode = root.FindAccessibilityNodeInfosByViewId(
|
||||
$"{root.PackageName}:id/{addressViewId}").FirstOrDefault();
|
||||
if(addressNode == null)
|
||||
{
|
||||
continue;
|
||||
}
|
||||
|
||||
uri = ExtractUri(uri, addressNode);
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
return uri;
|
||||
}
|
||||
|
||||
private string ExtractUri(string uri, AccessibilityNodeInfo addressNode)
|
||||
{
|
||||
if(addressNode != null)
|
||||
{
|
||||
uri = addressNode.Text;
|
||||
if(!uri.Contains("://"))
|
||||
{
|
||||
uri = string.Concat("http://", uri);
|
||||
}
|
||||
else if(Build.VERSION.SdkInt <= BuildVersionCodes.KitkatWatch)
|
||||
{
|
||||
var parts = uri.Split(new string[] { ". " }, StringSplitOptions.None);
|
||||
if(parts.Length > 1)
|
||||
{
|
||||
var urlPart = parts.FirstOrDefault(p => p.StartsWith("http"));
|
||||
if(urlPart != null)
|
||||
{
|
||||
uri = urlPart.Trim();
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
return uri;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Check to make sure it is ok to autofill still on the current screen
|
||||
/// </summary>
|
||||
private bool NeedToAutofill(AutofillCredentials creds, string currentUriString)
|
||||
{
|
||||
if(creds == null)
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
Uri lastUri, currentUri;
|
||||
if(Uri.TryCreate(creds.LastUri, UriKind.Absolute, out lastUri) &&
|
||||
Uri.TryCreate(currentUriString, UriKind.Absolute, out currentUri) &&
|
||||
lastUri.Host == currentUri.Host)
|
||||
{
|
||||
return true;
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
private static bool EditText(AccessibilityNodeInfo n)
|
||||
{
|
||||
return n.ClassName != null && n.ClassName.Contains("EditText");
|
||||
}
|
||||
|
||||
private void NotifyToAutofill(string uri)
|
||||
{
|
||||
var intent = new Intent(this, typeof(AutofillActivity));
|
||||
intent.PutExtra("uri", uri);
|
||||
intent.SetFlags(ActivityFlags.NewTask | ActivityFlags.SingleTop | ActivityFlags.ClearTop);
|
||||
var pendingIntent = PendingIntent.GetActivity(this, 0, intent, PendingIntentFlags.UpdateCurrent);
|
||||
|
||||
var builder = new Notification.Builder(this);
|
||||
builder.SetSmallIcon(Resource.Drawable.notification_sm)
|
||||
.SetContentTitle(App.Resources.AppResources.BitwardenAutofillService)
|
||||
.SetContentText(App.Resources.AppResources.BitwardenAutofillServiceNotificationContent)
|
||||
.SetTicker(App.Resources.AppResources.BitwardenAutofillServiceNotificationContent)
|
||||
.SetWhen(Java.Lang.JavaSystem.CurrentTimeMillis())
|
||||
.SetContentIntent(pendingIntent);
|
||||
|
||||
if(Build.VERSION.SdkInt > BuildVersionCodes.KitkatWatch)
|
||||
{
|
||||
builder.SetVisibility(NotificationVisibility.Secret)
|
||||
.SetColor(global::Android.Support.V4.Content.ContextCompat.GetColor(ApplicationContext,
|
||||
Resource.Color.primary));
|
||||
}
|
||||
|
||||
var notificationManager = (NotificationManager)GetSystemService(NotificationService);
|
||||
notificationManager.Notify(AutoFillNotificationId, builder.Build());
|
||||
}
|
||||
|
||||
private void FillCredentials(AccessibilityNodeInfo usernameNode, IEnumerable<AccessibilityNodeInfo> passwordNodes)
|
||||
{
|
||||
FillEditText(usernameNode, AutofillActivity.LastCredentials.Username);
|
||||
foreach(var n in passwordNodes)
|
||||
{
|
||||
FillEditText(n, AutofillActivity.LastCredentials.Password);
|
||||
}
|
||||
}
|
||||
|
||||
private static void FillEditText(AccessibilityNodeInfo editTextNode, string value)
|
||||
{
|
||||
if(editTextNode == null || value == null)
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
var bundle = new Bundle();
|
||||
bundle.PutString(AccessibilityNodeInfo.ActionArgumentSetTextCharsequence, value);
|
||||
editTextNode.PerformAction(global::Android.Views.Accessibility.Action.SetText, bundle);
|
||||
}
|
||||
|
||||
private IEnumerable<AccessibilityNodeInfo> GetWindowNodes(AccessibilityNodeInfo n,
|
||||
AccessibilityEvent e, Func<AccessibilityNodeInfo, bool> p)
|
||||
{
|
||||
if(n != null)
|
||||
{
|
||||
if(n.WindowId == e.WindowId && !(n.ViewIdResourceName?.StartsWith(SystemUiPackage) ?? false) && p(n))
|
||||
{
|
||||
yield return n;
|
||||
}
|
||||
|
||||
for(int i = 0; i < n.ChildCount; i++)
|
||||
{
|
||||
foreach(var node in GetWindowNodes(n.GetChild(i), e, p))
|
||||
{
|
||||
yield return node;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -16,11 +16,16 @@ namespace Bit.Android.Controls
|
||||
{
|
||||
public class ExtendedEntryRenderer : EntryRenderer
|
||||
{
|
||||
private bool _isPassword;
|
||||
private bool _toggledPassword;
|
||||
|
||||
protected override void OnElementChanged(ElementChangedEventArgs<Entry> e)
|
||||
{
|
||||
base.OnElementChanged(e);
|
||||
|
||||
var view = (ExtendedEntry)Element;
|
||||
_isPassword = view.IsPassword;
|
||||
|
||||
if(Control != null)
|
||||
{
|
||||
Control.SetIncludeFontPadding(false);
|
||||
@@ -56,8 +61,44 @@ namespace Bit.Android.Controls
|
||||
{
|
||||
Control.SetRawInputType(Control.InputType |= InputTypes.TextFlagNoSuggestions);
|
||||
}
|
||||
}
|
||||
|
||||
view.ToggleIsPassword += (object sender, EventArgs args) =>
|
||||
{
|
||||
var cursorStart = Control.SelectionStart;
|
||||
var cursorEnd = Control.SelectionEnd;
|
||||
|
||||
Control.TransformationMethod = _isPassword ? null : new PasswordTransformationMethod();
|
||||
|
||||
// set focus
|
||||
Control.RequestFocus();
|
||||
|
||||
if(_toggledPassword)
|
||||
{
|
||||
// restore cursor position
|
||||
Control.SetSelection(cursorStart, cursorEnd);
|
||||
}
|
||||
else
|
||||
{
|
||||
// set cursor to end
|
||||
Control.SetSelection(Control.Text.Length);
|
||||
}
|
||||
|
||||
// show keyboard
|
||||
var app = XLabs.Ioc.Resolver.Resolve<global::Android.App.Application>();
|
||||
var inputMethodManager =
|
||||
app.GetSystemService(global::Android.Content.Context.InputMethodService) as InputMethodManager;
|
||||
inputMethodManager.ShowSoftInput(Control, ShowFlags.Forced);
|
||||
inputMethodManager.ToggleSoftInput(ShowFlags.Forced, HideSoftInputFlags.ImplicitOnly);
|
||||
|
||||
_isPassword = view.IsPasswordFromToggled = !_isPassword;
|
||||
_toggledPassword = true;
|
||||
};
|
||||
|
||||
if(view.FontFamily == "monospace")
|
||||
{
|
||||
Control.Typeface = Typeface.Monospace;
|
||||
}
|
||||
}
|
||||
protected override void OnElementPropertyChanged(object sender, PropertyChangedEventArgs e)
|
||||
{
|
||||
var view = (ExtendedEntry)Element;
|
||||
@@ -76,6 +117,11 @@ namespace Bit.Android.Controls
|
||||
Control.SetBackgroundColor(view.BackgroundColor.ToAndroid());
|
||||
}
|
||||
}
|
||||
|
||||
if(view.FontFamily == "monospace")
|
||||
{
|
||||
Control.Typeface = Typeface.Monospace;
|
||||
}
|
||||
}
|
||||
|
||||
private void SetReturnType(ExtendedEntry view)
|
||||
|
||||
774
src/Android/CustomAndroidClientHandler.cs
Normal file
@@ -0,0 +1,774 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.IO;
|
||||
using System.IO.Compression;
|
||||
using System.Linq;
|
||||
using System.Net;
|
||||
using System.Net.Http;
|
||||
using System.Net.Http.Headers;
|
||||
using System.Text;
|
||||
using System.Threading;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
using Android.Runtime;
|
||||
using Java.IO;
|
||||
using Java.Net;
|
||||
using Java.Security;
|
||||
using Java.Security.Cert;
|
||||
using Javax.Net.Ssl;
|
||||
|
||||
namespace Xamarin.Android.Net
|
||||
{
|
||||
/// <summary>
|
||||
/// A custom implementation of <see cref="System.Net.Http.HttpClientHandler"/> which internally uses <see cref="Java.Net.HttpURLConnection"/>
|
||||
/// (or its HTTPS incarnation) to send HTTP requests.
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// <para>Instance of this class is used to configure <see cref="System.Net.Http.HttpClient"/> instance
|
||||
/// in the following way:
|
||||
///
|
||||
/// <example>
|
||||
/// var handler = new AndroidClientHandler {
|
||||
/// UseCookies = true,
|
||||
/// AutomaticDecompression = DecompressionMethods.Deflate | DecompressionMethods.GZip,
|
||||
/// };
|
||||
///
|
||||
/// var httpClient = new HttpClient (handler);
|
||||
/// var response = httpClient.GetAsync ("http://example.com")?.Result as AndroidHttpResponseMessage;
|
||||
/// </example></para>
|
||||
/// <para>
|
||||
/// The class supports pre-authentication of requests albeit in a slightly "manual" way. Namely, whenever a request to a server requiring authentication
|
||||
/// is made and no authentication credentials are provided in the <see cref="PreAuthenticationData"/> property (which is usually the case on the first
|
||||
/// request), the <see cref="RequestNeedsAuthorization"/> property will return <c>true</c> and the <see cref="RequestedAuthentication"/> property will
|
||||
/// contain all the authentication information gathered from the server. The application must then fill in the blanks (i.e. the credentials) and re-send
|
||||
/// the request configured to perform pre-authentication. The reason for this manual process is that the underlying Java HTTP client API supports only a
|
||||
/// single, VM-wide, authentication handler which cannot be configured to handle credentials for several requests. AndroidClientHandler, therefore, implements
|
||||
/// the authentication in managed .NET code. Message handler supports both Basic and Digest authentication. If an authentication scheme that's not supported
|
||||
/// by AndroidClientHandler is requested by the server, the application can provide its own authentication module (<see cref="AuthenticationData"/>,
|
||||
/// <see cref="PreAuthenticationData"/>) to handle the protocol authorization.</para>
|
||||
/// <para>AndroidClientHandler also supports requests to servers with "invalid" (e.g. self-signed) SSL certificates. Since this process is a bit convoluted using
|
||||
/// the Java APIs, AndroidClientHandler defines two ways to handle the situation. First, easier, is to store the necessary certificates (either CA or server certificates)
|
||||
/// in the <see cref="TrustedCerts"/> collection or, after deriving a custom class from AndroidClientHandler, by overriding one or more methods provided for this purpose
|
||||
/// (<see cref="ConfigureTrustManagerFactory"/>, <see cref="ConfigureKeyManagerFactory"/> and <see cref="ConfigureKeyStore"/>). The former method should be sufficient
|
||||
/// for most use cases, the latter allows the application to provide fully customized key store, trust manager and key manager, if needed. Note that the instance of
|
||||
/// AndroidClientHandler configured to accept an "invalid" certificate from the particular server will most likely fail to validate certificates from other servers (even
|
||||
/// if they use a certificate with a fully validated trust chain) unless you store the CA certificates from your Android system in <see cref="TrustedCerts"/> along with
|
||||
/// the self-signed certificate(s).</para>
|
||||
/// </remarks>
|
||||
public class CustomAndroidClientHandler : HttpClientHandler
|
||||
{
|
||||
sealed class RequestRedirectionState
|
||||
{
|
||||
public Uri NewUrl;
|
||||
public int RedirectCounter;
|
||||
public HttpMethod Method;
|
||||
}
|
||||
|
||||
internal const string LOG_APP = "monodroid-net";
|
||||
|
||||
const string GZIP_ENCODING = "gzip";
|
||||
const string DEFLATE_ENCODING = "deflate";
|
||||
const string IDENTITY_ENCODING = "identity";
|
||||
|
||||
static readonly HashSet<string> known_content_headers = new HashSet<string>(StringComparer.OrdinalIgnoreCase) {
|
||||
"Allow",
|
||||
"Content-Disposition",
|
||||
"Content-Encoding",
|
||||
"Content-Language",
|
||||
"Content-Length",
|
||||
"Content-Location",
|
||||
"Content-MD5",
|
||||
"Content-Range",
|
||||
"Content-Type",
|
||||
"Expires",
|
||||
"Last-Modified"
|
||||
};
|
||||
|
||||
static readonly List<IAndroidAuthenticationModule> authModules = new List<IAndroidAuthenticationModule> {
|
||||
new AuthModuleBasic (),
|
||||
// COMMENTED OUT: Kyle
|
||||
//new AuthModuleDigest ()
|
||||
};
|
||||
|
||||
bool disposed;
|
||||
|
||||
// Now all hail Java developers! Get this... HttpURLClient defaults to accepting AND
|
||||
// uncompressing the gzip content encoding UNLESS you set the Accept-Encoding header to ANY
|
||||
// value. So if we set it to 'gzip' below we WILL get gzipped stream but HttpURLClient will NOT
|
||||
// uncompress it any longer, doh. And they don't support 'deflate' so we need to handle it ourselves.
|
||||
bool decompress_here;
|
||||
|
||||
/// <summary>
|
||||
/// <para>
|
||||
/// Gets or sets the pre authentication data for the request. This property must be set by the application
|
||||
/// before the request is made. Generally the value can be taken from <see cref="RequestedAuthentication"/>
|
||||
/// after the initial request, without any authentication data, receives the authorization request from the
|
||||
/// server. The application must then store credentials in instance of <see cref="AuthenticationData"/> and
|
||||
/// assign the instance to this propery before retrying the request.
|
||||
/// </para>
|
||||
/// <para>
|
||||
/// The property is never set by AndroidClientHandler.
|
||||
/// </para>
|
||||
/// </summary>
|
||||
/// <value>The pre authentication data.</value>
|
||||
public AuthenticationData PreAuthenticationData { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// If the website requires authentication, this property will contain data about each scheme supported
|
||||
/// by the server after the response. Note that unauthorized request will return a valid response - you
|
||||
/// need to check the status code and and (re)configure AndroidClientHandler instance accordingly by providing
|
||||
/// both the credentials and the authentication scheme by setting the <see cref="PreAuthenticationData"/>
|
||||
/// property. If AndroidClientHandler is not able to detect the kind of authentication scheme it will store an
|
||||
/// instance of <see cref="AuthenticationData"/> with its <see cref="AuthenticationData.Scheme"/> property
|
||||
/// set to <c>AuthenticationScheme.Unsupported</c> and the application will be responsible for providing an
|
||||
/// instance of <see cref="IAndroidAuthenticationModule"/> which handles this kind of authorization scheme
|
||||
/// (<see cref="AuthenticationData.AuthModule"/>
|
||||
/// </summary>
|
||||
public IList<AuthenticationData> RequestedAuthentication { get; private set; }
|
||||
|
||||
/// <summary>
|
||||
/// Server authentication response indicates that the request to authorize comes from a proxy if this property is <c>true</c>.
|
||||
/// All the instances of <see cref="AuthenticationData"/> stored in the <see cref="RequestedAuthentication"/> property will
|
||||
/// have their <see cref="AuthenticationData.UseProxyAuthentication"/> preset to the same value as this property.
|
||||
/// </summary>
|
||||
public bool ProxyAuthenticationRequested { get; private set; }
|
||||
|
||||
/// <summary>
|
||||
/// If <c>true</c> then the server requested authorization and the application must use information
|
||||
/// found in <see cref="RequestedAuthentication"/> to set the value of <see cref="PreAuthenticationData"/>
|
||||
/// </summary>
|
||||
public bool RequestNeedsAuthorization
|
||||
{
|
||||
get { return RequestedAuthentication?.Count > 0; }
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// <para>
|
||||
/// If the request is to the server protected with a self-signed (or otherwise untrusted) SSL certificate, the request will
|
||||
/// fail security chain verification unless the application provides either the CA certificate of the entity which issued the
|
||||
/// server's certificate or, alternatively, provides the server public key. Whichever the case, the certificate(s) must be stored
|
||||
/// in this property in order for AndroidClientHandler to configure the request to accept the server certificate.</para>
|
||||
/// <para>AndroidClientHandler uses a custom <see cref="KeyStore"/> and <see cref="TrustManagerFactory"/> to configure the connection.
|
||||
/// If, however, the application requires finer control over the SSL configuration (e.g. it implements its own TrustManager) then
|
||||
/// it should leave this property empty and instead derive a custom class from AndroidClientHandler and override, as needed, the
|
||||
/// <see cref="ConfigureTrustManagerFactory"/>, <see cref="ConfigureKeyManagerFactory"/> and <see cref="ConfigureKeyStore"/> methods
|
||||
/// instead</para>
|
||||
/// </summary>
|
||||
/// <value>The trusted certs.</value>
|
||||
public IList<Certificate> TrustedCerts { get; set; }
|
||||
|
||||
protected override void Dispose(bool disposing)
|
||||
{
|
||||
disposed = true;
|
||||
|
||||
base.Dispose(disposing);
|
||||
}
|
||||
|
||||
protected void AssertSelf()
|
||||
{
|
||||
if(!disposed)
|
||||
return;
|
||||
throw new ObjectDisposedException(nameof(AndroidClientHandler));
|
||||
}
|
||||
|
||||
string EncodeUrl(Uri url)
|
||||
{
|
||||
if(url == null)
|
||||
return String.Empty;
|
||||
|
||||
if(String.IsNullOrEmpty(url.Query))
|
||||
return Uri.EscapeUriString(url.ToString());
|
||||
|
||||
// UriBuilder takes care of encoding everything properly
|
||||
var bldr = new UriBuilder(url);
|
||||
if(url.IsDefaultPort)
|
||||
bldr.Port = -1; // Avoids adding :80 or :443 to the host name in the result
|
||||
|
||||
// bldr.Uri.ToString () would ruin the good job UriBuilder did
|
||||
return bldr.ToString();
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Creates, configures and processes an asynchronous request to the indicated resource.
|
||||
/// </summary>
|
||||
/// <returns>Task in which the request is executed</returns>
|
||||
/// <param name="request">Request provided by <see cref="System.Net.Http.HttpClient"/></param>
|
||||
/// <param name="cancellationToken">Cancellation token.</param>
|
||||
protected override async Task<HttpResponseMessage> SendAsync(HttpRequestMessage request, CancellationToken cancellationToken)
|
||||
{
|
||||
AssertSelf();
|
||||
if(request == null)
|
||||
throw new ArgumentNullException(nameof(request));
|
||||
|
||||
if(!request.RequestUri.IsAbsoluteUri)
|
||||
throw new ArgumentException("Must represent an absolute URI", "request");
|
||||
|
||||
var redirectState = new RequestRedirectionState
|
||||
{
|
||||
NewUrl = request.RequestUri,
|
||||
RedirectCounter = 0,
|
||||
Method = request.Method
|
||||
};
|
||||
while(true)
|
||||
{
|
||||
URL java_url = new URL(EncodeUrl(redirectState.NewUrl));
|
||||
URLConnection java_connection = java_url.OpenConnection();
|
||||
HttpURLConnection httpConnection = await SetupRequestInternal(request, java_connection);
|
||||
HttpResponseMessage response = await ProcessRequest(request, java_url, httpConnection, cancellationToken, redirectState);
|
||||
if(response != null)
|
||||
return response;
|
||||
|
||||
if(redirectState.NewUrl == null)
|
||||
throw new InvalidOperationException("Request redirected but no new URI specified");
|
||||
request.Method = redirectState.Method;
|
||||
}
|
||||
}
|
||||
|
||||
Task<HttpResponseMessage> ProcessRequest(HttpRequestMessage request, URL javaUrl, HttpURLConnection httpConnection, CancellationToken cancellationToken, RequestRedirectionState redirectState)
|
||||
{
|
||||
cancellationToken.ThrowIfCancellationRequested();
|
||||
httpConnection.InstanceFollowRedirects = false; // We handle it ourselves
|
||||
RequestedAuthentication = null;
|
||||
ProxyAuthenticationRequested = false;
|
||||
|
||||
return DoProcessRequest(request, javaUrl, httpConnection, cancellationToken, redirectState);
|
||||
}
|
||||
|
||||
async Task<HttpResponseMessage> DoProcessRequest(HttpRequestMessage request, URL javaUrl, HttpURLConnection httpConnection, CancellationToken cancellationToken, RequestRedirectionState redirectState)
|
||||
{
|
||||
if(cancellationToken.IsCancellationRequested)
|
||||
{
|
||||
cancellationToken.ThrowIfCancellationRequested();
|
||||
}
|
||||
|
||||
try
|
||||
{
|
||||
await Task.WhenAny(
|
||||
httpConnection.ConnectAsync(),
|
||||
Task.Run(() => { cancellationToken.WaitHandle.WaitOne(); }))
|
||||
.ConfigureAwait(false);
|
||||
}
|
||||
catch(Java.Net.ConnectException ex)
|
||||
{
|
||||
// Wrap it nicely in a "standard" exception so that it's compatible with HttpClientHandler
|
||||
throw new WebException(ex.Message, ex, WebExceptionStatus.ConnectFailure, null);
|
||||
}
|
||||
|
||||
if(cancellationToken.IsCancellationRequested)
|
||||
{
|
||||
httpConnection.Disconnect();
|
||||
cancellationToken.ThrowIfCancellationRequested();
|
||||
}
|
||||
cancellationToken.Register(httpConnection.Disconnect);
|
||||
|
||||
if(httpConnection.DoOutput)
|
||||
{
|
||||
using(var stream = await request.Content.ReadAsStreamAsync())
|
||||
{
|
||||
await stream.CopyToAsync(httpConnection.OutputStream, 4096, cancellationToken)
|
||||
.ConfigureAwait(false);
|
||||
}
|
||||
}
|
||||
|
||||
if(cancellationToken.IsCancellationRequested)
|
||||
{
|
||||
httpConnection.Disconnect();
|
||||
cancellationToken.ThrowIfCancellationRequested();
|
||||
}
|
||||
|
||||
var statusCode = await Task.Run(() => (HttpStatusCode)httpConnection.ResponseCode).ConfigureAwait(false);
|
||||
var connectionUri = new Uri(httpConnection.URL.ToString());
|
||||
|
||||
// If the request was redirected we need to put the new URL in the request
|
||||
request.RequestUri = connectionUri;
|
||||
var ret = new AndroidHttpResponseMessage(javaUrl, httpConnection)
|
||||
{
|
||||
RequestMessage = request,
|
||||
ReasonPhrase = httpConnection.ResponseMessage,
|
||||
StatusCode = statusCode,
|
||||
};
|
||||
|
||||
bool disposeRet;
|
||||
if(HandleRedirect(statusCode, httpConnection, redirectState, out disposeRet))
|
||||
{
|
||||
if(disposeRet)
|
||||
{
|
||||
ret.Dispose();
|
||||
ret = null;
|
||||
}
|
||||
return ret;
|
||||
}
|
||||
|
||||
switch(statusCode)
|
||||
{
|
||||
case HttpStatusCode.Unauthorized:
|
||||
case HttpStatusCode.ProxyAuthenticationRequired:
|
||||
// We don't resend the request since that would require new set of credentials if the
|
||||
// ones provided in Credentials are invalid (or null) and that, in turn, may require asking the
|
||||
// user which is not something that should be taken care of by us and in this
|
||||
// context. The application should be responsible for this.
|
||||
// HttpClientHandler throws an exception in this instance, but I think it's not a good
|
||||
// idea. We'll return the response message with all the information required by the
|
||||
// application to fill in the blanks and provide the requested credentials instead.
|
||||
//
|
||||
// We return the body of the response too, but the Java client will throw
|
||||
// a FileNotFound exception if we attempt to access the input stream.
|
||||
// Instead we try to read the error stream and return an default message if the error stream isn't readable.
|
||||
ret.Content = GetErrorContent(httpConnection, new StringContent("Unauthorized", Encoding.ASCII));
|
||||
CopyHeaders(httpConnection, ret);
|
||||
|
||||
if(ret.Headers.WwwAuthenticate != null)
|
||||
{
|
||||
ProxyAuthenticationRequested = false;
|
||||
CollectAuthInfo(ret.Headers.WwwAuthenticate);
|
||||
}
|
||||
else if(ret.Headers.ProxyAuthenticate != null)
|
||||
{
|
||||
ProxyAuthenticationRequested = true;
|
||||
CollectAuthInfo(ret.Headers.ProxyAuthenticate);
|
||||
}
|
||||
|
||||
// COMMENTED OUT: Kyle
|
||||
//ret.RequestedAuthentication = RequestedAuthentication;
|
||||
return ret;
|
||||
}
|
||||
|
||||
if(!IsErrorStatusCode(statusCode))
|
||||
{
|
||||
ret.Content = GetContent(httpConnection, httpConnection.InputStream);
|
||||
}
|
||||
else
|
||||
{
|
||||
// For 400 >= response code <= 599 the Java client throws the FileNotFound exception when attempting to read from the input stream.
|
||||
// Instead we try to read the error stream and return an empty string if the error stream isn't readable.
|
||||
ret.Content = GetErrorContent(httpConnection, new StringContent(String.Empty, Encoding.ASCII));
|
||||
}
|
||||
|
||||
CopyHeaders(httpConnection, ret);
|
||||
|
||||
IEnumerable<string> cookieHeaderValue;
|
||||
if(!UseCookies || CookieContainer == null || !ret.Headers.TryGetValues("Set-Cookie", out cookieHeaderValue) || cookieHeaderValue == null)
|
||||
{
|
||||
return ret;
|
||||
}
|
||||
|
||||
try
|
||||
{
|
||||
CookieContainer.SetCookies(connectionUri, String.Join(",", cookieHeaderValue));
|
||||
}
|
||||
catch(Exception ex)
|
||||
{
|
||||
// We don't want to terminate the response because of a bad cookie, hence just reporting
|
||||
// the issue. We might consider adding a virtual method to let the user handle the
|
||||
// issue, but not sure if it's really needed. Set-Cookie header will be part of the
|
||||
// header collection so the user can always examine it if they spot an error.
|
||||
}
|
||||
|
||||
return ret;
|
||||
}
|
||||
|
||||
HttpContent GetErrorContent(HttpURLConnection httpConnection, HttpContent fallbackContent)
|
||||
{
|
||||
var contentStream = httpConnection.ErrorStream;
|
||||
|
||||
if(contentStream != null)
|
||||
{
|
||||
return GetContent(httpConnection, contentStream);
|
||||
}
|
||||
|
||||
return fallbackContent;
|
||||
}
|
||||
|
||||
HttpContent GetContent(URLConnection httpConnection, Stream contentStream)
|
||||
{
|
||||
Stream inputStream = new BufferedStream(contentStream);
|
||||
if(decompress_here)
|
||||
{
|
||||
string[] encodings = httpConnection.ContentEncoding?.Split(',');
|
||||
if(encodings != null)
|
||||
{
|
||||
if(encodings.Contains(GZIP_ENCODING, StringComparer.OrdinalIgnoreCase))
|
||||
inputStream = new GZipStream(inputStream, CompressionMode.Decompress);
|
||||
else if(encodings.Contains(DEFLATE_ENCODING, StringComparer.OrdinalIgnoreCase))
|
||||
inputStream = new DeflateStream(inputStream, CompressionMode.Decompress);
|
||||
}
|
||||
}
|
||||
return new StreamContent(inputStream);
|
||||
}
|
||||
|
||||
bool HandleRedirect(HttpStatusCode redirectCode, HttpURLConnection httpConnection, RequestRedirectionState redirectState, out bool disposeRet)
|
||||
{
|
||||
if(!AllowAutoRedirect)
|
||||
{
|
||||
disposeRet = false;
|
||||
return true; // We shouldn't follow and there's no data to fetch, just return
|
||||
}
|
||||
disposeRet = true;
|
||||
|
||||
redirectState.NewUrl = null;
|
||||
switch(redirectCode)
|
||||
{
|
||||
case HttpStatusCode.MultipleChoices: // 300
|
||||
break;
|
||||
|
||||
case HttpStatusCode.Moved: // 301
|
||||
case HttpStatusCode.Redirect: // 302
|
||||
case HttpStatusCode.SeeOther: // 303
|
||||
redirectState.Method = HttpMethod.Get;
|
||||
break;
|
||||
|
||||
case HttpStatusCode.TemporaryRedirect: // 307
|
||||
break;
|
||||
|
||||
default:
|
||||
if((int)redirectCode >= 300 && (int)redirectCode < 400)
|
||||
throw new InvalidOperationException($"HTTP Redirection status code {redirectCode} ({(int)redirectCode}) not supported");
|
||||
return false;
|
||||
}
|
||||
|
||||
IDictionary<string, IList<string>> headers = httpConnection.HeaderFields;
|
||||
IList<string> locationHeader;
|
||||
if(!headers.TryGetValue("Location", out locationHeader) || locationHeader == null || locationHeader.Count == 0)
|
||||
throw new InvalidOperationException($"HTTP connection redirected with code {redirectCode} ({(int)redirectCode}) but no Location header found in response");
|
||||
|
||||
|
||||
redirectState.RedirectCounter++;
|
||||
if(redirectState.RedirectCounter >= MaxAutomaticRedirections)
|
||||
throw new WebException($"Maximum automatic redirections exceeded (allowed {MaxAutomaticRedirections}, redirected {redirectState.RedirectCounter} times)");
|
||||
|
||||
Uri location = new Uri(locationHeader[0], UriKind.Absolute);
|
||||
redirectState.NewUrl = location;
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
bool IsErrorStatusCode(HttpStatusCode statusCode)
|
||||
{
|
||||
return (int)statusCode >= 400 && (int)statusCode <= 599;
|
||||
}
|
||||
|
||||
void CollectAuthInfo(HttpHeaderValueCollection<AuthenticationHeaderValue> headers)
|
||||
{
|
||||
var authData = new List<AuthenticationData>(headers.Count);
|
||||
|
||||
foreach(AuthenticationHeaderValue ahv in headers)
|
||||
{
|
||||
var data = new AuthenticationData
|
||||
{
|
||||
Scheme = GetAuthScheme(ahv.Scheme),
|
||||
// COMMENTED OUT: Kyle
|
||||
//Challenge = $"{ahv.Scheme} {ahv.Parameter}",
|
||||
UseProxyAuthentication = ProxyAuthenticationRequested
|
||||
};
|
||||
authData.Add(data);
|
||||
}
|
||||
|
||||
RequestedAuthentication = authData.AsReadOnly();
|
||||
}
|
||||
|
||||
AuthenticationScheme GetAuthScheme(string scheme)
|
||||
{
|
||||
if(String.Compare("basic", scheme, StringComparison.OrdinalIgnoreCase) == 0)
|
||||
return AuthenticationScheme.Basic;
|
||||
if(String.Compare("digest", scheme, StringComparison.OrdinalIgnoreCase) == 0)
|
||||
return AuthenticationScheme.Digest;
|
||||
|
||||
return AuthenticationScheme.Unsupported;
|
||||
}
|
||||
|
||||
void CopyHeaders(HttpURLConnection httpConnection, HttpResponseMessage response)
|
||||
{
|
||||
IDictionary<string, IList<string>> headers = httpConnection.HeaderFields;
|
||||
foreach(string key in headers.Keys)
|
||||
{
|
||||
if(key == null) // First header entry has null key, it corresponds to the response message
|
||||
continue;
|
||||
|
||||
HttpHeaders item_headers;
|
||||
string kind;
|
||||
if(known_content_headers.Contains(key))
|
||||
{
|
||||
kind = "content";
|
||||
item_headers = response.Content.Headers;
|
||||
}
|
||||
else
|
||||
{
|
||||
kind = "response";
|
||||
item_headers = response.Headers;
|
||||
}
|
||||
item_headers.TryAddWithoutValidation(key, headers[key]);
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Configure the <see cref="HttpURLConnection"/> before the request is sent. This method is meant to be overriden
|
||||
/// by applications which need to perform some extra configuration steps on the connection. It is called with all
|
||||
/// the request headers set, pre-authentication performed (if applicable) but before the request body is set
|
||||
/// (e.g. for POST requests). The default implementation in AndroidClientHandler does nothing.
|
||||
/// </summary>
|
||||
/// <param name="request">Request data</param>
|
||||
/// <param name="conn">Pre-configured connection instance</param>
|
||||
protected virtual Task SetupRequest(HttpRequestMessage request, HttpURLConnection conn)
|
||||
{
|
||||
return Task.Factory.StartNew(AssertSelf);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Configures the key store. The <paramref name="keyStore"/> parameter is set to instance of <see cref="KeyStore"/>
|
||||
/// created using the <see cref="KeyStore.DefaultType"/> type and with populated with certificates provided in the <see cref="TrustedCerts"/>
|
||||
/// property. AndroidClientHandler implementation simply returns the instance passed in the <paramref name="keyStore"/> parameter
|
||||
/// </summary>
|
||||
/// <returns>The key store.</returns>
|
||||
/// <param name="keyStore">Key store to configure.</param>
|
||||
protected virtual KeyStore ConfigureKeyStore(KeyStore keyStore)
|
||||
{
|
||||
AssertSelf();
|
||||
|
||||
return keyStore;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Create and configure an instance of <see cref="KeyManagerFactory"/>. The <paramref name="keyStore"/> parameter is set to the
|
||||
/// return value of the <see cref="ConfigureKeyStore"/> method, so it might be null if the application overrode the method and provided
|
||||
/// no key store. It will not be <c>null</c> when the default implementation is used. The application can return <c>null</c> here since
|
||||
/// KeyManagerFactory is not required for the custom SSL configuration, but it might be used by the application to implement a more advanced
|
||||
/// mechanism of key management.
|
||||
/// </summary>
|
||||
/// <returns>The key manager factory or <c>null</c>.</returns>
|
||||
/// <param name="keyStore">Key store.</param>
|
||||
protected virtual KeyManagerFactory ConfigureKeyManagerFactory(KeyStore keyStore)
|
||||
{
|
||||
AssertSelf();
|
||||
|
||||
return null;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Create and configure an instance of <see cref="TrustManagerFactory"/>. The <paramref name="keyStore"/> parameter is set to the
|
||||
/// return value of the <see cref="ConfigureKeyStore"/> method, so it might be null if the application overrode the method and provided
|
||||
/// no key store. It will not be <c>null</c> when the default implementation is used. The application can return <c>null</c> from this
|
||||
/// method in which case AndroidClientHandler will create its own instance of the trust manager factory provided that the <see cref="TrustCerts"/>
|
||||
/// list contains at least one valid certificate. If there are no valid certificates and this method returns <c>null</c>, no custom
|
||||
/// trust manager will be created since that would make all the HTTPS requests fail.
|
||||
/// </summary>
|
||||
/// <returns>The trust manager factory.</returns>
|
||||
/// <param name="keyStore">Key store.</param>
|
||||
protected virtual TrustManagerFactory ConfigureTrustManagerFactory(KeyStore keyStore)
|
||||
{
|
||||
AssertSelf();
|
||||
|
||||
return null;
|
||||
}
|
||||
|
||||
void AppendEncoding(string encoding, ref List<string> list)
|
||||
{
|
||||
if(list == null)
|
||||
list = new List<string>();
|
||||
if(list.Contains(encoding))
|
||||
return;
|
||||
list.Add(encoding);
|
||||
}
|
||||
|
||||
async Task<HttpURLConnection> SetupRequestInternal(HttpRequestMessage request, URLConnection conn)
|
||||
{
|
||||
if(conn == null)
|
||||
throw new ArgumentNullException(nameof(conn));
|
||||
var httpConnection = conn.JavaCast<HttpURLConnection>();
|
||||
if(httpConnection == null)
|
||||
throw new InvalidOperationException($"Unsupported URL scheme {conn.URL.Protocol}");
|
||||
|
||||
httpConnection.RequestMethod = request.Method.ToString();
|
||||
|
||||
// SSL context must be set up as soon as possible, before adding any content or
|
||||
// headers. Otherwise Java won't use the socket factory
|
||||
SetupSSL(httpConnection as HttpsURLConnection);
|
||||
if(request.Content != null)
|
||||
AddHeaders(httpConnection, request.Content.Headers);
|
||||
AddHeaders(httpConnection, request.Headers);
|
||||
|
||||
List<string> accept_encoding = null;
|
||||
|
||||
decompress_here = false;
|
||||
if((AutomaticDecompression & DecompressionMethods.GZip) != 0)
|
||||
{
|
||||
AppendEncoding(GZIP_ENCODING, ref accept_encoding);
|
||||
decompress_here = true;
|
||||
}
|
||||
|
||||
if((AutomaticDecompression & DecompressionMethods.Deflate) != 0)
|
||||
{
|
||||
AppendEncoding(DEFLATE_ENCODING, ref accept_encoding);
|
||||
decompress_here = true;
|
||||
}
|
||||
|
||||
if(AutomaticDecompression == DecompressionMethods.None)
|
||||
{
|
||||
accept_encoding?.Clear();
|
||||
AppendEncoding(IDENTITY_ENCODING, ref accept_encoding); // Turns off compression for the Java client
|
||||
}
|
||||
|
||||
if(accept_encoding?.Count > 0)
|
||||
httpConnection.SetRequestProperty("Accept-Encoding", String.Join(",", accept_encoding));
|
||||
|
||||
if(UseCookies && CookieContainer != null)
|
||||
{
|
||||
string cookieHeaderValue = CookieContainer.GetCookieHeader(request.RequestUri);
|
||||
if(!String.IsNullOrEmpty(cookieHeaderValue))
|
||||
httpConnection.SetRequestProperty("Cookie", cookieHeaderValue);
|
||||
}
|
||||
|
||||
HandlePreAuthentication(httpConnection);
|
||||
await SetupRequest(request, httpConnection);
|
||||
SetupRequestBody(httpConnection, request);
|
||||
|
||||
return httpConnection;
|
||||
}
|
||||
|
||||
void SetupSSL(HttpsURLConnection httpsConnection)
|
||||
{
|
||||
if(httpsConnection == null)
|
||||
return;
|
||||
|
||||
KeyStore keyStore = KeyStore.GetInstance(KeyStore.DefaultType);
|
||||
keyStore.Load(null, null);
|
||||
bool gotCerts = TrustedCerts?.Count > 0;
|
||||
if(gotCerts)
|
||||
{
|
||||
for(int i = 0; i < TrustedCerts.Count; i++)
|
||||
{
|
||||
Certificate cert = TrustedCerts[i];
|
||||
if(cert == null)
|
||||
continue;
|
||||
keyStore.SetCertificateEntry($"ca{i}", cert);
|
||||
}
|
||||
}
|
||||
keyStore = ConfigureKeyStore(keyStore);
|
||||
KeyManagerFactory kmf = ConfigureKeyManagerFactory(keyStore);
|
||||
TrustManagerFactory tmf = ConfigureTrustManagerFactory(keyStore);
|
||||
|
||||
if(tmf == null)
|
||||
{
|
||||
// If there are no certs and no trust manager factory, we can't use a custom manager
|
||||
// because it will cause all the HTTPS requests to fail because of unverified trust
|
||||
// chain
|
||||
if(!gotCerts)
|
||||
return;
|
||||
|
||||
tmf = TrustManagerFactory.GetInstance(TrustManagerFactory.DefaultAlgorithm);
|
||||
tmf.Init(keyStore);
|
||||
}
|
||||
|
||||
SSLContext context = SSLContext.GetInstance("TLS");
|
||||
context.Init(kmf?.GetKeyManagers(), tmf.GetTrustManagers(), null);
|
||||
httpsConnection.SSLSocketFactory = context.SocketFactory;
|
||||
}
|
||||
|
||||
void HandlePreAuthentication(HttpURLConnection httpConnection)
|
||||
{
|
||||
AuthenticationData data = PreAuthenticationData;
|
||||
if(!PreAuthenticate || data == null)
|
||||
return;
|
||||
|
||||
ICredentials creds = data.UseProxyAuthentication ? Proxy?.Credentials : Credentials;
|
||||
if(creds == null)
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
IAndroidAuthenticationModule auth = data.Scheme == AuthenticationScheme.Unsupported ? data.AuthModule : authModules.Find(m => m?.Scheme == data.Scheme);
|
||||
if(auth == null)
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
Authorization authorization = auth.Authenticate(data.Challenge, httpConnection, creds);
|
||||
if(authorization == null)
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
httpConnection.SetRequestProperty(data.UseProxyAuthentication ? "Proxy-Authorization" : "Authorization", authorization.Message);
|
||||
}
|
||||
|
||||
void AddHeaders(HttpURLConnection conn, HttpHeaders headers)
|
||||
{
|
||||
if(headers == null)
|
||||
return;
|
||||
|
||||
foreach(KeyValuePair<string, IEnumerable<string>> header in headers)
|
||||
{
|
||||
conn.SetRequestProperty(header.Key, header.Value != null ? String.Join(",", header.Value) : String.Empty);
|
||||
}
|
||||
}
|
||||
|
||||
void SetupRequestBody(HttpURLConnection httpConnection, HttpRequestMessage request)
|
||||
{
|
||||
if(request.Content == null)
|
||||
{
|
||||
// Pilfered from System.Net.Http.HttpClientHandler:SendAync
|
||||
if(HttpMethod.Post.Equals(request.Method) || HttpMethod.Put.Equals(request.Method) || HttpMethod.Delete.Equals(request.Method))
|
||||
{
|
||||
// Explicitly set this to make sure we're sending a "Content-Length: 0" header.
|
||||
// This fixes the issue that's been reported on the forums:
|
||||
// http://forums.xamarin.com/discussion/17770/length-required-error-in-http-post-since-latest-release
|
||||
httpConnection.SetRequestProperty("Content-Length", "0");
|
||||
}
|
||||
return;
|
||||
}
|
||||
|
||||
httpConnection.DoOutput = true;
|
||||
long? contentLength = request.Content.Headers.ContentLength;
|
||||
if(contentLength != null)
|
||||
httpConnection.SetFixedLengthStreamingMode((int)contentLength);
|
||||
else
|
||||
httpConnection.SetChunkedStreamingMode(0);
|
||||
}
|
||||
}
|
||||
|
||||
sealed class AuthModuleBasic : IAndroidAuthenticationModule
|
||||
{
|
||||
public AuthenticationScheme Scheme { get; } = AuthenticationScheme.Basic;
|
||||
public string AuthenticationType { get; } = "Basic";
|
||||
public bool CanPreAuthenticate { get; } = true;
|
||||
|
||||
public Authorization Authenticate(string challenge, HttpURLConnection request, ICredentials credentials)
|
||||
{
|
||||
string header = challenge?.Trim();
|
||||
if(credentials == null || String.IsNullOrEmpty(header))
|
||||
return null;
|
||||
|
||||
if(header.IndexOf("basic", StringComparison.OrdinalIgnoreCase) == -1)
|
||||
return null;
|
||||
|
||||
return InternalAuthenticate(request, credentials);
|
||||
}
|
||||
|
||||
public Authorization PreAuthenticate(HttpURLConnection request, ICredentials credentials)
|
||||
{
|
||||
return InternalAuthenticate(request, credentials);
|
||||
}
|
||||
|
||||
Authorization InternalAuthenticate(HttpURLConnection request, ICredentials credentials)
|
||||
{
|
||||
if(request == null || credentials == null)
|
||||
return null;
|
||||
|
||||
NetworkCredential cred = credentials.GetCredential(new Uri(request.URL.ToString()), AuthenticationType.ToLowerInvariant());
|
||||
if(cred == null)
|
||||
return null;
|
||||
|
||||
if(String.IsNullOrEmpty(cred.UserName))
|
||||
return null;
|
||||
|
||||
string domain = cred.Domain?.Trim();
|
||||
string response = String.Empty;
|
||||
|
||||
// If domain is set, MS sends "domain\user:password".
|
||||
if(!String.IsNullOrEmpty(domain))
|
||||
response = domain + "\\";
|
||||
response += cred.UserName + ":" + cred.Password;
|
||||
|
||||
return new Authorization($"{AuthenticationType} {Convert.ToBase64String(Encoding.ASCII.GetBytes(response))}");
|
||||
}
|
||||
}
|
||||
}
|
||||
1
src/Android/EnvironmentVariables.txt
Normal file
@@ -0,0 +1 @@
|
||||
XA_HTTP_CLIENT_HANDLER_TYPE=Xamarin.Android.Net.AndroidClientHandler
|
||||
@@ -14,6 +14,7 @@ using System.Reflection;
|
||||
using Xamarin.Forms.Platform.Android;
|
||||
using Xamarin.Forms;
|
||||
using System.Threading.Tasks;
|
||||
using Bit.App.Models.Page;
|
||||
|
||||
namespace Bit.Android
|
||||
{
|
||||
@@ -27,6 +28,30 @@ namespace Bit.Android
|
||||
|
||||
protected override void OnCreate(Bundle bundle)
|
||||
{
|
||||
string uri = null;
|
||||
if(!Intent.Flags.HasFlag(ActivityFlags.LaunchedFromHistory) && Intent.HasExtra("uri") && Intent.HasExtra("ts"))
|
||||
{
|
||||
var tsDiff = Java.Lang.JavaSystem.CurrentTimeMillis() - Intent.GetLongExtra("ts", 0);
|
||||
if(tsDiff < 5000)
|
||||
{
|
||||
uri = Intent.GetStringExtra("uri");
|
||||
}
|
||||
|
||||
// Attempt to clear intent for future
|
||||
Intent.ReplaceExtras(new Bundle());
|
||||
Intent.SetAction(string.Empty);
|
||||
Intent.SetData(null);
|
||||
Intent.SetFlags(0);
|
||||
}
|
||||
|
||||
if(!Resolver.IsSet)
|
||||
{
|
||||
MainApplication.SetIoc(Application);
|
||||
}
|
||||
|
||||
var policy = new StrictMode.ThreadPolicy.Builder().PermitAll().Build();
|
||||
StrictMode.SetThreadPolicy(policy);
|
||||
|
||||
ToolbarResource = Resource.Layout.toolbar;
|
||||
TabLayoutResource = Resource.Layout.tabs;
|
||||
|
||||
@@ -51,8 +76,8 @@ namespace Bit.Android
|
||||
typeof(Color).GetProperty("Accent", BindingFlags.Public | BindingFlags.Static)
|
||||
.SetValue(null, Color.FromHex("d2d6de"));
|
||||
|
||||
|
||||
LoadApplication(new App.App(
|
||||
uri,
|
||||
Resolver.Resolve<IAuthService>(),
|
||||
Resolver.Resolve<IConnectivity>(),
|
||||
Resolver.Resolve<IUserDialogs>(),
|
||||
@@ -61,12 +86,56 @@ namespace Bit.Android
|
||||
Resolver.Resolve<IFingerprint>(),
|
||||
Resolver.Resolve<ISettings>(),
|
||||
Resolver.Resolve<ILockService>(),
|
||||
Resolver.Resolve<IGoogleAnalyticsService>()));
|
||||
Resolver.Resolve<IGoogleAnalyticsService>(),
|
||||
Resolver.Resolve<ILocalizeService>(),
|
||||
Resolver.Resolve<IAppInfoService>()));
|
||||
|
||||
MessagingCenter.Subscribe<Xamarin.Forms.Application>(Xamarin.Forms.Application.Current, "RateApp", (sender) =>
|
||||
{
|
||||
RateApp();
|
||||
});
|
||||
|
||||
MessagingCenter.Subscribe<Xamarin.Forms.Application>(Xamarin.Forms.Application.Current, "Accessibility", (sender) =>
|
||||
{
|
||||
OpenAccessibilitySettings();
|
||||
});
|
||||
|
||||
MessagingCenter.Subscribe<Xamarin.Forms.Application, VaultListPageModel.Login>(
|
||||
Xamarin.Forms.Application.Current, "Autofill", (sender, args) =>
|
||||
{
|
||||
ReturnCredentials(args);
|
||||
});
|
||||
|
||||
MessagingCenter.Subscribe<Xamarin.Forms.Application>(Xamarin.Forms.Application.Current, "BackgroundApp", (sender) =>
|
||||
{
|
||||
MoveTaskToBack(true);
|
||||
});
|
||||
}
|
||||
|
||||
private void ReturnCredentials(VaultListPageModel.Login login)
|
||||
{
|
||||
Intent data = new Intent();
|
||||
if(login == null)
|
||||
{
|
||||
data.PutExtra("canceled", "true");
|
||||
}
|
||||
else
|
||||
{
|
||||
data.PutExtra("uri", login.Uri.Value);
|
||||
data.PutExtra("username", login.Username);
|
||||
data.PutExtra("password", login.Password.Value);
|
||||
}
|
||||
|
||||
if(Parent == null)
|
||||
{
|
||||
SetResult(Result.Ok, data);
|
||||
}
|
||||
else
|
||||
{
|
||||
Parent.SetResult(Result.Ok, data);
|
||||
}
|
||||
|
||||
Finish();
|
||||
}
|
||||
|
||||
protected override void OnPause()
|
||||
@@ -101,8 +170,12 @@ namespace Bit.Android
|
||||
|
||||
protected override void OnResume()
|
||||
{
|
||||
Console.WriteLine("A OnResume");
|
||||
base.OnResume();
|
||||
Console.WriteLine("A OnResume");
|
||||
|
||||
// workaround for app compat bug
|
||||
// ref https://bugzilla.xamarin.com/show_bug.cgi?id=36907
|
||||
Task.Delay(10).Wait();
|
||||
}
|
||||
|
||||
public void RateApp()
|
||||
@@ -136,5 +209,11 @@ namespace Bit.Android
|
||||
intent.AddFlags(flags);
|
||||
return intent;
|
||||
}
|
||||
|
||||
private void OpenAccessibilitySettings()
|
||||
{
|
||||
var intent = new Intent(global::Android.Provider.Settings.ActionAccessibilitySettings);
|
||||
StartActivity(intent);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -19,6 +19,7 @@ using XLabs.Ioc;
|
||||
using XLabs.Ioc.Unity;
|
||||
using System.Threading.Tasks;
|
||||
using Plugin.Settings.Abstractions;
|
||||
using Xamarin.Android.Net;
|
||||
|
||||
namespace Bit.Android
|
||||
{
|
||||
@@ -37,9 +38,12 @@ namespace Bit.Android
|
||||
public MainApplication(IntPtr handle, JniHandleOwnership transer)
|
||||
: base(handle, transer)
|
||||
{
|
||||
// NOTE: This is just here to stop the linker from removing AndroidClientHandler references
|
||||
var handler = new AndroidClientHandler();
|
||||
|
||||
if(!Resolver.IsSet)
|
||||
{
|
||||
SetIoc();
|
||||
SetIoc(this);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -174,16 +178,16 @@ namespace Bit.Android
|
||||
}
|
||||
}
|
||||
|
||||
private void SetIoc()
|
||||
public static void SetIoc(Application application)
|
||||
{
|
||||
UserDialogs.Init(this);
|
||||
UserDialogs.Init(application);
|
||||
|
||||
var container = new UnityContainer();
|
||||
|
||||
container
|
||||
// Android Stuff
|
||||
.RegisterInstance(ApplicationContext)
|
||||
.RegisterInstance<Application>(this)
|
||||
.RegisterInstance(application.ApplicationContext)
|
||||
.RegisterInstance<Application>(application)
|
||||
// Services
|
||||
.RegisterType<IDatabaseService, DatabaseService>(new ContainerControlledLifetimeManager())
|
||||
.RegisterType<ISqlService, SqlService>(new ContainerControlledLifetimeManager())
|
||||
@@ -192,7 +196,7 @@ namespace Bit.Android
|
||||
.RegisterType<IKeyDerivationService, BouncyCastleKeyDerivationService>(new ContainerControlledLifetimeManager())
|
||||
.RegisterType<IAuthService, AuthService>(new ContainerControlledLifetimeManager())
|
||||
.RegisterType<IFolderService, FolderService>(new ContainerControlledLifetimeManager())
|
||||
.RegisterType<ISiteService, SiteService>(new ContainerControlledLifetimeManager())
|
||||
.RegisterType<ILoginService, LoginService>(new ContainerControlledLifetimeManager())
|
||||
.RegisterType<ISyncService, SyncService>(new ContainerControlledLifetimeManager())
|
||||
.RegisterType<IClipboardService, ClipboardService>(new ContainerControlledLifetimeManager())
|
||||
.RegisterType<IPushNotificationListener, PushNotificationListener>(new ContainerControlledLifetimeManager())
|
||||
@@ -203,15 +207,22 @@ namespace Bit.Android
|
||||
.RegisterType<IAppInfoService, AppInfoService>(new ContainerControlledLifetimeManager())
|
||||
.RegisterType<IGoogleAnalyticsService, GoogleAnalyticsService>(new ContainerControlledLifetimeManager())
|
||||
.RegisterType<IDeviceInfoService, DeviceInfoService>(new ContainerControlledLifetimeManager())
|
||||
.RegisterType<ILocalizeService, LocalizeService>(new ContainerControlledLifetimeManager())
|
||||
.RegisterType<ILogService, LogService>(new ContainerControlledLifetimeManager())
|
||||
.RegisterType<IHttpService, HttpService>(new ContainerControlledLifetimeManager())
|
||||
.RegisterType<ITokenService, TokenService>(new ContainerControlledLifetimeManager())
|
||||
.RegisterType<ISettingsService, SettingsService>(new ContainerControlledLifetimeManager())
|
||||
// Repositories
|
||||
.RegisterType<IFolderRepository, FolderRepository>(new ContainerControlledLifetimeManager())
|
||||
.RegisterType<IFolderApiRepository, FolderApiRepository>(new ContainerControlledLifetimeManager())
|
||||
.RegisterType<ISiteRepository, SiteRepository>(new ContainerControlledLifetimeManager())
|
||||
.RegisterType<ISiteApiRepository, SiteApiRepository>(new ContainerControlledLifetimeManager())
|
||||
.RegisterType<IAuthApiRepository, AuthApiRepository>(new ContainerControlledLifetimeManager())
|
||||
.RegisterType<ILoginRepository, LoginRepository>(new ContainerControlledLifetimeManager())
|
||||
.RegisterType<ILoginApiRepository, LoginApiRepository>(new ContainerControlledLifetimeManager())
|
||||
.RegisterType<IConnectApiRepository, ConnectApiRepository>(new ContainerControlledLifetimeManager())
|
||||
.RegisterType<IDeviceApiRepository, DeviceApiRepository>(new ContainerControlledLifetimeManager())
|
||||
.RegisterType<IAccountsApiRepository, AccountsApiRepository>(new ContainerControlledLifetimeManager())
|
||||
.RegisterType<ICipherApiRepository, CipherApiRepository>(new ContainerControlledLifetimeManager())
|
||||
.RegisterType<ISettingsRepository, SettingsRepository>(new ContainerControlledLifetimeManager())
|
||||
.RegisterType<ISettingsApiRepository, SettingsApiRepository>(new ContainerControlledLifetimeManager())
|
||||
// Other
|
||||
.RegisterInstance(CrossSettings.Current, new ContainerControlledLifetimeManager())
|
||||
.RegisterInstance(CrossConnectivity.Current, new ContainerControlledLifetimeManager())
|
||||
|
||||
@@ -1,12 +1,14 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<manifest xmlns:android="http://schemas.android.com/apk/res/android" package="com.x8bit.bitwarden" android:versionName="1.0.0" android:installLocation="auto" android:versionCode="7">
|
||||
<uses-sdk android:minSdkVersion="19" android:targetSdkVersion="23" />
|
||||
<uses-permission android:name="android.permission.INTERNET" />
|
||||
<uses-permission android:name="android.permission.USE_FINGERPRINT" />
|
||||
<uses-permission android:name="android.permission.SYSTEM_ALERT_WINDOW" />
|
||||
<uses-permission android:name="android.permission.WAKE_LOCK" />
|
||||
<uses-permission android:name="com.google.android.c2dm.permission.RECEIVE" />
|
||||
<uses-permission android:name="com.x8bit.bitwarden.permission.C2D_MESSAGE" />
|
||||
<uses-permission android:name="android.permission.GET_ACCOUNTS" />
|
||||
<application android:label="bitwarden" android:theme="@style/BitwardenTheme"></application>
|
||||
<manifest xmlns:android="http://schemas.android.com/apk/res/android" package="com.x8bit.bitwarden" android:versionName="1.3.0" android:installLocation="auto" android:versionCode="101">
|
||||
<uses-sdk android:minSdkVersion="19" android:targetSdkVersion="23" />
|
||||
<uses-permission android:name="android.permission.INTERNET" />
|
||||
<uses-permission android:name="android.permission.USE_FINGERPRINT" />
|
||||
<uses-permission android:name="com.samsung.android.providers.context.permission.WRITE_USE_APP_FEATURE_SURVEY" />
|
||||
<uses-permission android:name="android.permission.SYSTEM_ALERT_WINDOW" />
|
||||
<uses-permission android:name="android.permission.WAKE_LOCK" />
|
||||
<uses-permission android:name="com.google.android.c2dm.permission.RECEIVE" />
|
||||
<uses-permission android:name="com.x8bit.bitwarden.permission.C2D_MESSAGE" />
|
||||
<uses-permission android:name="android.permission.GET_ACCOUNTS" />
|
||||
<application android:label="bitwarden" android:theme="@style/BitwardenTheme">
|
||||
</application>
|
||||
</manifest>
|
||||
348
src/Android/Resources/Resource.Designer.cs
generated
@@ -183,7 +183,6 @@ namespace Bit.Android
|
||||
global::HockeyApp.Resource.Style.HockeyApp_ButtonStyle = global::Bit.Android.Resource.Style.HockeyApp_ButtonStyle;
|
||||
global::HockeyApp.Resource.Style.HockeyApp_EditTextStyle = global::Bit.Android.Resource.Style.HockeyApp_EditTextStyle;
|
||||
global::HockeyApp.Resource.Style.HockeyApp_SingleLineInputStyle = global::Bit.Android.Resource.Style.HockeyApp_SingleLineInputStyle;
|
||||
global::ModernHttpClient.Resource.String.library_name = global::Bit.Android.Resource.String.library_name;
|
||||
global::PCLCrypto.Resource.String.ApplicationName = global::Bit.Android.Resource.String.ApplicationName;
|
||||
global::PCLCrypto.Resource.String.Hello = global::Bit.Android.Resource.String.Hello;
|
||||
global::Plugin.Fingerprint.Resource.Drawable.fingerprint_white = global::Bit.Android.Resource.Drawable.fingerprint_white;
|
||||
@@ -2282,487 +2281,505 @@ namespace Bit.Android
|
||||
public const int abc_textfield_search_material = 2130837578;
|
||||
|
||||
// aapt resource value: 0x7f02004b
|
||||
public const int cloudup = 2130837579;
|
||||
public const int accessibility_notification = 2130837579;
|
||||
|
||||
// aapt resource value: 0x7f02004c
|
||||
public const int cogs = 2130837580;
|
||||
public const int accessibility_notification_icon = 2130837580;
|
||||
|
||||
// aapt resource value: 0x7f02004d
|
||||
public const int cogs_selected = 2130837581;
|
||||
public const int accessibility_step1 = 2130837581;
|
||||
|
||||
// aapt resource value: 0x7f02004e
|
||||
public const int common_full_open_on_phone = 2130837582;
|
||||
public const int accessibility_step2 = 2130837582;
|
||||
|
||||
// aapt resource value: 0x7f02004f
|
||||
public const int common_google_signin_btn_icon_dark = 2130837583;
|
||||
public const int close = 2130837583;
|
||||
|
||||
// aapt resource value: 0x7f020050
|
||||
public const int common_google_signin_btn_icon_dark_disabled = 2130837584;
|
||||
public const int cloudup = 2130837584;
|
||||
|
||||
// aapt resource value: 0x7f020051
|
||||
public const int common_google_signin_btn_icon_dark_focused = 2130837585;
|
||||
public const int cogs = 2130837585;
|
||||
|
||||
// aapt resource value: 0x7f020052
|
||||
public const int common_google_signin_btn_icon_dark_normal = 2130837586;
|
||||
public const int cogs_selected = 2130837586;
|
||||
|
||||
// aapt resource value: 0x7f020053
|
||||
public const int common_google_signin_btn_icon_dark_pressed = 2130837587;
|
||||
public const int common_full_open_on_phone = 2130837587;
|
||||
|
||||
// aapt resource value: 0x7f020054
|
||||
public const int common_google_signin_btn_icon_light = 2130837588;
|
||||
public const int common_google_signin_btn_icon_dark = 2130837588;
|
||||
|
||||
// aapt resource value: 0x7f020055
|
||||
public const int common_google_signin_btn_icon_light_disabled = 2130837589;
|
||||
public const int common_google_signin_btn_icon_dark_disabled = 2130837589;
|
||||
|
||||
// aapt resource value: 0x7f020056
|
||||
public const int common_google_signin_btn_icon_light_focused = 2130837590;
|
||||
public const int common_google_signin_btn_icon_dark_focused = 2130837590;
|
||||
|
||||
// aapt resource value: 0x7f020057
|
||||
public const int common_google_signin_btn_icon_light_normal = 2130837591;
|
||||
public const int common_google_signin_btn_icon_dark_normal = 2130837591;
|
||||
|
||||
// aapt resource value: 0x7f020058
|
||||
public const int common_google_signin_btn_icon_light_pressed = 2130837592;
|
||||
public const int common_google_signin_btn_icon_dark_pressed = 2130837592;
|
||||
|
||||
// aapt resource value: 0x7f020059
|
||||
public const int common_google_signin_btn_text_dark = 2130837593;
|
||||
public const int common_google_signin_btn_icon_light = 2130837593;
|
||||
|
||||
// aapt resource value: 0x7f02005a
|
||||
public const int common_google_signin_btn_text_dark_disabled = 2130837594;
|
||||
public const int common_google_signin_btn_icon_light_disabled = 2130837594;
|
||||
|
||||
// aapt resource value: 0x7f02005b
|
||||
public const int common_google_signin_btn_text_dark_focused = 2130837595;
|
||||
public const int common_google_signin_btn_icon_light_focused = 2130837595;
|
||||
|
||||
// aapt resource value: 0x7f02005c
|
||||
public const int common_google_signin_btn_text_dark_normal = 2130837596;
|
||||
public const int common_google_signin_btn_icon_light_normal = 2130837596;
|
||||
|
||||
// aapt resource value: 0x7f02005d
|
||||
public const int common_google_signin_btn_text_dark_pressed = 2130837597;
|
||||
public const int common_google_signin_btn_icon_light_pressed = 2130837597;
|
||||
|
||||
// aapt resource value: 0x7f02005e
|
||||
public const int common_google_signin_btn_text_light = 2130837598;
|
||||
public const int common_google_signin_btn_text_dark = 2130837598;
|
||||
|
||||
// aapt resource value: 0x7f02005f
|
||||
public const int common_google_signin_btn_text_light_disabled = 2130837599;
|
||||
public const int common_google_signin_btn_text_dark_disabled = 2130837599;
|
||||
|
||||
// aapt resource value: 0x7f020060
|
||||
public const int common_google_signin_btn_text_light_focused = 2130837600;
|
||||
public const int common_google_signin_btn_text_dark_focused = 2130837600;
|
||||
|
||||
// aapt resource value: 0x7f020061
|
||||
public const int common_google_signin_btn_text_light_normal = 2130837601;
|
||||
public const int common_google_signin_btn_text_dark_normal = 2130837601;
|
||||
|
||||
// aapt resource value: 0x7f020062
|
||||
public const int common_google_signin_btn_text_light_pressed = 2130837602;
|
||||
public const int common_google_signin_btn_text_dark_pressed = 2130837602;
|
||||
|
||||
// aapt resource value: 0x7f020063
|
||||
public const int common_ic_googleplayservices = 2130837603;
|
||||
public const int common_google_signin_btn_text_light = 2130837603;
|
||||
|
||||
// aapt resource value: 0x7f020064
|
||||
public const int common_plus_signin_btn_icon_dark = 2130837604;
|
||||
public const int common_google_signin_btn_text_light_disabled = 2130837604;
|
||||
|
||||
// aapt resource value: 0x7f020065
|
||||
public const int common_plus_signin_btn_icon_dark_disabled = 2130837605;
|
||||
public const int common_google_signin_btn_text_light_focused = 2130837605;
|
||||
|
||||
// aapt resource value: 0x7f020066
|
||||
public const int common_plus_signin_btn_icon_dark_focused = 2130837606;
|
||||
public const int common_google_signin_btn_text_light_normal = 2130837606;
|
||||
|
||||
// aapt resource value: 0x7f020067
|
||||
public const int common_plus_signin_btn_icon_dark_normal = 2130837607;
|
||||
public const int common_google_signin_btn_text_light_pressed = 2130837607;
|
||||
|
||||
// aapt resource value: 0x7f020068
|
||||
public const int common_plus_signin_btn_icon_dark_pressed = 2130837608;
|
||||
public const int common_ic_googleplayservices = 2130837608;
|
||||
|
||||
// aapt resource value: 0x7f020069
|
||||
public const int common_plus_signin_btn_icon_light = 2130837609;
|
||||
public const int common_plus_signin_btn_icon_dark = 2130837609;
|
||||
|
||||
// aapt resource value: 0x7f02006a
|
||||
public const int common_plus_signin_btn_icon_light_disabled = 2130837610;
|
||||
public const int common_plus_signin_btn_icon_dark_disabled = 2130837610;
|
||||
|
||||
// aapt resource value: 0x7f02006b
|
||||
public const int common_plus_signin_btn_icon_light_focused = 2130837611;
|
||||
public const int common_plus_signin_btn_icon_dark_focused = 2130837611;
|
||||
|
||||
// aapt resource value: 0x7f02006c
|
||||
public const int common_plus_signin_btn_icon_light_normal = 2130837612;
|
||||
public const int common_plus_signin_btn_icon_dark_normal = 2130837612;
|
||||
|
||||
// aapt resource value: 0x7f02006d
|
||||
public const int common_plus_signin_btn_icon_light_pressed = 2130837613;
|
||||
public const int common_plus_signin_btn_icon_dark_pressed = 2130837613;
|
||||
|
||||
// aapt resource value: 0x7f02006e
|
||||
public const int common_plus_signin_btn_text_dark = 2130837614;
|
||||
public const int common_plus_signin_btn_icon_light = 2130837614;
|
||||
|
||||
// aapt resource value: 0x7f02006f
|
||||
public const int common_plus_signin_btn_text_dark_disabled = 2130837615;
|
||||
public const int common_plus_signin_btn_icon_light_disabled = 2130837615;
|
||||
|
||||
// aapt resource value: 0x7f020070
|
||||
public const int common_plus_signin_btn_text_dark_focused = 2130837616;
|
||||
public const int common_plus_signin_btn_icon_light_focused = 2130837616;
|
||||
|
||||
// aapt resource value: 0x7f020071
|
||||
public const int common_plus_signin_btn_text_dark_normal = 2130837617;
|
||||
public const int common_plus_signin_btn_icon_light_normal = 2130837617;
|
||||
|
||||
// aapt resource value: 0x7f020072
|
||||
public const int common_plus_signin_btn_text_dark_pressed = 2130837618;
|
||||
public const int common_plus_signin_btn_icon_light_pressed = 2130837618;
|
||||
|
||||
// aapt resource value: 0x7f020073
|
||||
public const int common_plus_signin_btn_text_light = 2130837619;
|
||||
public const int common_plus_signin_btn_text_dark = 2130837619;
|
||||
|
||||
// aapt resource value: 0x7f020074
|
||||
public const int common_plus_signin_btn_text_light_disabled = 2130837620;
|
||||
public const int common_plus_signin_btn_text_dark_disabled = 2130837620;
|
||||
|
||||
// aapt resource value: 0x7f020075
|
||||
public const int common_plus_signin_btn_text_light_focused = 2130837621;
|
||||
public const int common_plus_signin_btn_text_dark_focused = 2130837621;
|
||||
|
||||
// aapt resource value: 0x7f020076
|
||||
public const int common_plus_signin_btn_text_light_normal = 2130837622;
|
||||
public const int common_plus_signin_btn_text_dark_normal = 2130837622;
|
||||
|
||||
// aapt resource value: 0x7f020077
|
||||
public const int common_plus_signin_btn_text_light_pressed = 2130837623;
|
||||
public const int common_plus_signin_btn_text_dark_pressed = 2130837623;
|
||||
|
||||
// aapt resource value: 0x7f020078
|
||||
public const int design_fab_background = 2130837624;
|
||||
public const int common_plus_signin_btn_text_light = 2130837624;
|
||||
|
||||
// aapt resource value: 0x7f020079
|
||||
public const int design_snackbar_background = 2130837625;
|
||||
public const int common_plus_signin_btn_text_light_disabled = 2130837625;
|
||||
|
||||
// aapt resource value: 0x7f02007a
|
||||
public const int envelope = 2130837626;
|
||||
public const int common_plus_signin_btn_text_light_focused = 2130837626;
|
||||
|
||||
// aapt resource value: 0x7f02007b
|
||||
public const int eye = 2130837627;
|
||||
public const int common_plus_signin_btn_text_light_normal = 2130837627;
|
||||
|
||||
// aapt resource value: 0x7f02007c
|
||||
public const int eye_slash = 2130837628;
|
||||
public const int common_plus_signin_btn_text_light_pressed = 2130837628;
|
||||
|
||||
// aapt resource value: 0x7f02007d
|
||||
public const int fa_lock = 2130837629;
|
||||
public const int design_fab_background = 2130837629;
|
||||
|
||||
// aapt resource value: 0x7f02007e
|
||||
public const int fa_lock_selected = 2130837630;
|
||||
public const int design_snackbar_background = 2130837630;
|
||||
|
||||
// aapt resource value: 0x7f02007f
|
||||
public const int fingerprint = 2130837631;
|
||||
public const int envelope = 2130837631;
|
||||
|
||||
// aapt resource value: 0x7f020080
|
||||
public const int fingerprint_white = 2130837632;
|
||||
public const int eye = 2130837632;
|
||||
|
||||
// aapt resource value: 0x7f020081
|
||||
public const int folder = 2130837633;
|
||||
public const int eye_slash = 2130837633;
|
||||
|
||||
// aapt resource value: 0x7f020082
|
||||
public const int globe = 2130837634;
|
||||
public const int fa_lock = 2130837634;
|
||||
|
||||
// aapt resource value: 0x7f020083
|
||||
public const int hockeyapp_btn_background = 2130837635;
|
||||
public const int fa_lock_selected = 2130837635;
|
||||
|
||||
// aapt resource value: 0x7f020084
|
||||
public const int ic_audiotrack = 2130837636;
|
||||
public const int fingerprint = 2130837636;
|
||||
|
||||
// aapt resource value: 0x7f020085
|
||||
public const int ic_audiotrack_light = 2130837637;
|
||||
public const int fingerprint_white = 2130837637;
|
||||
|
||||
// aapt resource value: 0x7f020086
|
||||
public const int ic_bluetooth_grey = 2130837638;
|
||||
public const int folder = 2130837638;
|
||||
|
||||
// aapt resource value: 0x7f020087
|
||||
public const int ic_bluetooth_white = 2130837639;
|
||||
public const int globe = 2130837639;
|
||||
|
||||
// aapt resource value: 0x7f020088
|
||||
public const int ic_cast_dark = 2130837640;
|
||||
public const int hockeyapp_btn_background = 2130837640;
|
||||
|
||||
// aapt resource value: 0x7f020089
|
||||
public const int ic_cast_disabled_light = 2130837641;
|
||||
public const int ic_audiotrack = 2130837641;
|
||||
|
||||
// aapt resource value: 0x7f02008a
|
||||
public const int ic_cast_grey = 2130837642;
|
||||
public const int ic_audiotrack_light = 2130837642;
|
||||
|
||||
// aapt resource value: 0x7f02008b
|
||||
public const int ic_cast_light = 2130837643;
|
||||
public const int ic_bluetooth_grey = 2130837643;
|
||||
|
||||
// aapt resource value: 0x7f02008c
|
||||
public const int ic_cast_off_light = 2130837644;
|
||||
public const int ic_bluetooth_white = 2130837644;
|
||||
|
||||
// aapt resource value: 0x7f02008d
|
||||
public const int ic_cast_on_0_light = 2130837645;
|
||||
public const int ic_cast_dark = 2130837645;
|
||||
|
||||
// aapt resource value: 0x7f02008e
|
||||
public const int ic_cast_on_1_light = 2130837646;
|
||||
public const int ic_cast_disabled_light = 2130837646;
|
||||
|
||||
// aapt resource value: 0x7f02008f
|
||||
public const int ic_cast_on_2_light = 2130837647;
|
||||
public const int ic_cast_grey = 2130837647;
|
||||
|
||||
// aapt resource value: 0x7f020090
|
||||
public const int ic_cast_on_light = 2130837648;
|
||||
public const int ic_cast_light = 2130837648;
|
||||
|
||||
// aapt resource value: 0x7f020091
|
||||
public const int ic_cast_white = 2130837649;
|
||||
public const int ic_cast_off_light = 2130837649;
|
||||
|
||||
// aapt resource value: 0x7f020092
|
||||
public const int ic_close_dark = 2130837650;
|
||||
public const int ic_cast_on_0_light = 2130837650;
|
||||
|
||||
// aapt resource value: 0x7f020093
|
||||
public const int ic_close_light = 2130837651;
|
||||
public const int ic_cast_on_1_light = 2130837651;
|
||||
|
||||
// aapt resource value: 0x7f020094
|
||||
public const int ic_collapse = 2130837652;
|
||||
public const int ic_cast_on_2_light = 2130837652;
|
||||
|
||||
// aapt resource value: 0x7f020095
|
||||
public const int ic_collapse_00000 = 2130837653;
|
||||
public const int ic_cast_on_light = 2130837653;
|
||||
|
||||
// aapt resource value: 0x7f020096
|
||||
public const int ic_collapse_00001 = 2130837654;
|
||||
public const int ic_cast_white = 2130837654;
|
||||
|
||||
// aapt resource value: 0x7f020097
|
||||
public const int ic_collapse_00002 = 2130837655;
|
||||
public const int ic_close_dark = 2130837655;
|
||||
|
||||
// aapt resource value: 0x7f020098
|
||||
public const int ic_collapse_00003 = 2130837656;
|
||||
public const int ic_close_light = 2130837656;
|
||||
|
||||
// aapt resource value: 0x7f020099
|
||||
public const int ic_collapse_00004 = 2130837657;
|
||||
public const int ic_collapse = 2130837657;
|
||||
|
||||
// aapt resource value: 0x7f02009a
|
||||
public const int ic_collapse_00005 = 2130837658;
|
||||
public const int ic_collapse_00000 = 2130837658;
|
||||
|
||||
// aapt resource value: 0x7f02009b
|
||||
public const int ic_collapse_00006 = 2130837659;
|
||||
public const int ic_collapse_00001 = 2130837659;
|
||||
|
||||
// aapt resource value: 0x7f02009c
|
||||
public const int ic_collapse_00007 = 2130837660;
|
||||
public const int ic_collapse_00002 = 2130837660;
|
||||
|
||||
// aapt resource value: 0x7f02009d
|
||||
public const int ic_collapse_00008 = 2130837661;
|
||||
public const int ic_collapse_00003 = 2130837661;
|
||||
|
||||
// aapt resource value: 0x7f02009e
|
||||
public const int ic_collapse_00009 = 2130837662;
|
||||
public const int ic_collapse_00004 = 2130837662;
|
||||
|
||||
// aapt resource value: 0x7f02009f
|
||||
public const int ic_collapse_00010 = 2130837663;
|
||||
public const int ic_collapse_00005 = 2130837663;
|
||||
|
||||
// aapt resource value: 0x7f0200a0
|
||||
public const int ic_collapse_00011 = 2130837664;
|
||||
public const int ic_collapse_00006 = 2130837664;
|
||||
|
||||
// aapt resource value: 0x7f0200a1
|
||||
public const int ic_collapse_00012 = 2130837665;
|
||||
public const int ic_collapse_00007 = 2130837665;
|
||||
|
||||
// aapt resource value: 0x7f0200a2
|
||||
public const int ic_collapse_00013 = 2130837666;
|
||||
public const int ic_collapse_00008 = 2130837666;
|
||||
|
||||
// aapt resource value: 0x7f0200a3
|
||||
public const int ic_collapse_00014 = 2130837667;
|
||||
public const int ic_collapse_00009 = 2130837667;
|
||||
|
||||
// aapt resource value: 0x7f0200a4
|
||||
public const int ic_collapse_00015 = 2130837668;
|
||||
public const int ic_collapse_00010 = 2130837668;
|
||||
|
||||
// aapt resource value: 0x7f0200a5
|
||||
public const int ic_errorstatus = 2130837669;
|
||||
public const int ic_collapse_00011 = 2130837669;
|
||||
|
||||
// aapt resource value: 0x7f0200a6
|
||||
public const int ic_expand = 2130837670;
|
||||
public const int ic_collapse_00012 = 2130837670;
|
||||
|
||||
// aapt resource value: 0x7f0200a7
|
||||
public const int ic_expand_00000 = 2130837671;
|
||||
public const int ic_collapse_00013 = 2130837671;
|
||||
|
||||
// aapt resource value: 0x7f0200a8
|
||||
public const int ic_expand_00001 = 2130837672;
|
||||
public const int ic_collapse_00014 = 2130837672;
|
||||
|
||||
// aapt resource value: 0x7f0200a9
|
||||
public const int ic_expand_00002 = 2130837673;
|
||||
public const int ic_collapse_00015 = 2130837673;
|
||||
|
||||
// aapt resource value: 0x7f0200aa
|
||||
public const int ic_expand_00003 = 2130837674;
|
||||
public const int ic_errorstatus = 2130837674;
|
||||
|
||||
// aapt resource value: 0x7f0200ab
|
||||
public const int ic_expand_00004 = 2130837675;
|
||||
public const int ic_expand = 2130837675;
|
||||
|
||||
// aapt resource value: 0x7f0200ac
|
||||
public const int ic_expand_00005 = 2130837676;
|
||||
public const int ic_expand_00000 = 2130837676;
|
||||
|
||||
// aapt resource value: 0x7f0200ad
|
||||
public const int ic_expand_00006 = 2130837677;
|
||||
public const int ic_expand_00001 = 2130837677;
|
||||
|
||||
// aapt resource value: 0x7f0200ae
|
||||
public const int ic_expand_00007 = 2130837678;
|
||||
public const int ic_expand_00002 = 2130837678;
|
||||
|
||||
// aapt resource value: 0x7f0200af
|
||||
public const int ic_expand_00008 = 2130837679;
|
||||
public const int ic_expand_00003 = 2130837679;
|
||||
|
||||
// aapt resource value: 0x7f0200b0
|
||||
public const int ic_expand_00009 = 2130837680;
|
||||
public const int ic_expand_00004 = 2130837680;
|
||||
|
||||
// aapt resource value: 0x7f0200b1
|
||||
public const int ic_expand_00010 = 2130837681;
|
||||
public const int ic_expand_00005 = 2130837681;
|
||||
|
||||
// aapt resource value: 0x7f0200b2
|
||||
public const int ic_expand_00011 = 2130837682;
|
||||
public const int ic_expand_00006 = 2130837682;
|
||||
|
||||
// aapt resource value: 0x7f0200b3
|
||||
public const int ic_expand_00012 = 2130837683;
|
||||
public const int ic_expand_00007 = 2130837683;
|
||||
|
||||
// aapt resource value: 0x7f0200b4
|
||||
public const int ic_expand_00013 = 2130837684;
|
||||
public const int ic_expand_00008 = 2130837684;
|
||||
|
||||
// aapt resource value: 0x7f0200b5
|
||||
public const int ic_expand_00014 = 2130837685;
|
||||
public const int ic_expand_00009 = 2130837685;
|
||||
|
||||
// aapt resource value: 0x7f0200b6
|
||||
public const int ic_expand_00015 = 2130837686;
|
||||
public const int ic_expand_00010 = 2130837686;
|
||||
|
||||
// aapt resource value: 0x7f0200b7
|
||||
public const int ic_media_pause = 2130837687;
|
||||
public const int ic_expand_00011 = 2130837687;
|
||||
|
||||
// aapt resource value: 0x7f0200b8
|
||||
public const int ic_media_play = 2130837688;
|
||||
public const int ic_expand_00012 = 2130837688;
|
||||
|
||||
// aapt resource value: 0x7f0200b9
|
||||
public const int ic_media_route_disabled_mono_dark = 2130837689;
|
||||
public const int ic_expand_00013 = 2130837689;
|
||||
|
||||
// aapt resource value: 0x7f0200ba
|
||||
public const int ic_media_route_off_mono_dark = 2130837690;
|
||||
public const int ic_expand_00014 = 2130837690;
|
||||
|
||||
// aapt resource value: 0x7f0200bb
|
||||
public const int ic_media_route_on_0_mono_dark = 2130837691;
|
||||
public const int ic_expand_00015 = 2130837691;
|
||||
|
||||
// aapt resource value: 0x7f0200bc
|
||||
public const int ic_media_route_on_1_mono_dark = 2130837692;
|
||||
public const int ic_media_pause = 2130837692;
|
||||
|
||||
// aapt resource value: 0x7f0200bd
|
||||
public const int ic_media_route_on_2_mono_dark = 2130837693;
|
||||
public const int ic_media_play = 2130837693;
|
||||
|
||||
// aapt resource value: 0x7f0200be
|
||||
public const int ic_media_route_on_mono_dark = 2130837694;
|
||||
public const int ic_media_route_disabled_mono_dark = 2130837694;
|
||||
|
||||
// aapt resource value: 0x7f0200bf
|
||||
public const int ic_pause_dark = 2130837695;
|
||||
public const int ic_media_route_off_mono_dark = 2130837695;
|
||||
|
||||
// aapt resource value: 0x7f0200c0
|
||||
public const int ic_pause_light = 2130837696;
|
||||
public const int ic_media_route_on_0_mono_dark = 2130837696;
|
||||
|
||||
// aapt resource value: 0x7f0200c1
|
||||
public const int ic_play_dark = 2130837697;
|
||||
public const int ic_media_route_on_1_mono_dark = 2130837697;
|
||||
|
||||
// aapt resource value: 0x7f0200c2
|
||||
public const int ic_play_light = 2130837698;
|
||||
public const int ic_media_route_on_2_mono_dark = 2130837698;
|
||||
|
||||
// aapt resource value: 0x7f0200c3
|
||||
public const int ic_speaker_dark = 2130837699;
|
||||
public const int ic_media_route_on_mono_dark = 2130837699;
|
||||
|
||||
// aapt resource value: 0x7f0200c4
|
||||
public const int ic_speaker_group_dark = 2130837700;
|
||||
public const int ic_pause_dark = 2130837700;
|
||||
|
||||
// aapt resource value: 0x7f0200c5
|
||||
public const int ic_speaker_group_light = 2130837701;
|
||||
public const int ic_pause_light = 2130837701;
|
||||
|
||||
// aapt resource value: 0x7f0200c6
|
||||
public const int ic_speaker_light = 2130837702;
|
||||
public const int ic_play_dark = 2130837702;
|
||||
|
||||
// aapt resource value: 0x7f0200c7
|
||||
public const int ic_successstatus = 2130837703;
|
||||
public const int ic_play_light = 2130837703;
|
||||
|
||||
// aapt resource value: 0x7f0200c8
|
||||
public const int ic_tv_dark = 2130837704;
|
||||
public const int ic_speaker_dark = 2130837704;
|
||||
|
||||
// aapt resource value: 0x7f0200c9
|
||||
public const int ic_tv_light = 2130837705;
|
||||
public const int ic_speaker_group_dark = 2130837705;
|
||||
|
||||
// aapt resource value: 0x7f0200ca
|
||||
public const int icon = 2130837706;
|
||||
public const int ic_speaker_group_light = 2130837706;
|
||||
|
||||
// aapt resource value: 0x7f0200cb
|
||||
public const int ion_chevron_right = 2130837707;
|
||||
public const int ic_speaker_light = 2130837707;
|
||||
|
||||
// aapt resource value: 0x7f0200cc
|
||||
public const int lightbulb = 2130837708;
|
||||
public const int ic_successstatus = 2130837708;
|
||||
|
||||
// aapt resource value: 0x7f0200cd
|
||||
public const int list_selector = 2130837709;
|
||||
public const int ic_tv_dark = 2130837709;
|
||||
|
||||
// aapt resource value: 0x7f0200ce
|
||||
public const int @lock = 2130837710;
|
||||
public const int ic_tv_light = 2130837710;
|
||||
|
||||
// aapt resource value: 0x7f0200cf
|
||||
public const int logo = 2130837711;
|
||||
public const int icon = 2130837711;
|
||||
|
||||
// aapt resource value: 0x7f0200d0
|
||||
public const int more = 2130837712;
|
||||
public const int ion_chevron_right = 2130837712;
|
||||
|
||||
// aapt resource value: 0x7f0200d1
|
||||
public const int mr_dialog_material_background_dark = 2130837713;
|
||||
public const int lightbulb = 2130837713;
|
||||
|
||||
// aapt resource value: 0x7f0200d2
|
||||
public const int mr_dialog_material_background_light = 2130837714;
|
||||
public const int list_selector = 2130837714;
|
||||
|
||||
// aapt resource value: 0x7f0200d3
|
||||
public const int mr_ic_audiotrack_light = 2130837715;
|
||||
public const int @lock = 2130837715;
|
||||
|
||||
// aapt resource value: 0x7f0200d4
|
||||
public const int mr_ic_cast_dark = 2130837716;
|
||||
public const int logo = 2130837716;
|
||||
|
||||
// aapt resource value: 0x7f0200d5
|
||||
public const int mr_ic_cast_light = 2130837717;
|
||||
public const int more = 2130837717;
|
||||
|
||||
// aapt resource value: 0x7f0200d6
|
||||
public const int mr_ic_close_dark = 2130837718;
|
||||
public const int mr_dialog_material_background_dark = 2130837718;
|
||||
|
||||
// aapt resource value: 0x7f0200d7
|
||||
public const int mr_ic_close_light = 2130837719;
|
||||
public const int mr_dialog_material_background_light = 2130837719;
|
||||
|
||||
// aapt resource value: 0x7f0200d8
|
||||
public const int mr_ic_media_route_connecting_mono_dark = 2130837720;
|
||||
public const int mr_ic_audiotrack_light = 2130837720;
|
||||
|
||||
// aapt resource value: 0x7f0200d9
|
||||
public const int mr_ic_media_route_connecting_mono_light = 2130837721;
|
||||
public const int mr_ic_cast_dark = 2130837721;
|
||||
|
||||
// aapt resource value: 0x7f0200da
|
||||
public const int mr_ic_media_route_mono_dark = 2130837722;
|
||||
public const int mr_ic_cast_light = 2130837722;
|
||||
|
||||
// aapt resource value: 0x7f0200db
|
||||
public const int mr_ic_media_route_mono_light = 2130837723;
|
||||
public const int mr_ic_close_dark = 2130837723;
|
||||
|
||||
// aapt resource value: 0x7f0200dc
|
||||
public const int mr_ic_pause_dark = 2130837724;
|
||||
public const int mr_ic_close_light = 2130837724;
|
||||
|
||||
// aapt resource value: 0x7f0200dd
|
||||
public const int mr_ic_pause_light = 2130837725;
|
||||
public const int mr_ic_media_route_connecting_mono_dark = 2130837725;
|
||||
|
||||
// aapt resource value: 0x7f0200de
|
||||
public const int mr_ic_play_dark = 2130837726;
|
||||
public const int mr_ic_media_route_connecting_mono_light = 2130837726;
|
||||
|
||||
// aapt resource value: 0x7f0200df
|
||||
public const int mr_ic_play_light = 2130837727;
|
||||
|
||||
// aapt resource value: 0x7f0200eb
|
||||
public const int notification_template_icon_bg = 2130837739;
|
||||
public const int mr_ic_media_route_mono_dark = 2130837727;
|
||||
|
||||
// aapt resource value: 0x7f0200e0
|
||||
public const int plus = 2130837728;
|
||||
public const int mr_ic_media_route_mono_light = 2130837728;
|
||||
|
||||
// aapt resource value: 0x7f0200e1
|
||||
public const int refresh = 2130837729;
|
||||
public const int mr_ic_pause_dark = 2130837729;
|
||||
|
||||
// aapt resource value: 0x7f0200e2
|
||||
public const int roundedbg = 2130837730;
|
||||
public const int mr_ic_pause_light = 2130837730;
|
||||
|
||||
// aapt resource value: 0x7f0200e3
|
||||
public const int roundedbgdark = 2130837731;
|
||||
public const int mr_ic_play_dark = 2130837731;
|
||||
|
||||
// aapt resource value: 0x7f0200e4
|
||||
public const int splash_screen = 2130837732;
|
||||
public const int mr_ic_play_light = 2130837732;
|
||||
|
||||
// aapt resource value: 0x7f0200e5
|
||||
public const int star = 2130837733;
|
||||
public const int notification_sm = 2130837733;
|
||||
|
||||
// aapt resource value: 0x7f0200f1
|
||||
public const int notification_template_icon_bg = 2130837745;
|
||||
|
||||
// aapt resource value: 0x7f0200e6
|
||||
public const int star_selected = 2130837734;
|
||||
public const int plus = 2130837734;
|
||||
|
||||
// aapt resource value: 0x7f0200e7
|
||||
public const int tools = 2130837735;
|
||||
public const int refresh = 2130837735;
|
||||
|
||||
// aapt resource value: 0x7f0200e8
|
||||
public const int tools_selected = 2130837736;
|
||||
public const int roundedbg = 2130837736;
|
||||
|
||||
// aapt resource value: 0x7f0200e9
|
||||
public const int upload = 2130837737;
|
||||
public const int roundedbgdark = 2130837737;
|
||||
|
||||
// aapt resource value: 0x7f0200ea
|
||||
public const int user = 2130837738;
|
||||
public const int splash_screen = 2130837738;
|
||||
|
||||
// aapt resource value: 0x7f0200eb
|
||||
public const int star = 2130837739;
|
||||
|
||||
// aapt resource value: 0x7f0200ec
|
||||
public const int star_selected = 2130837740;
|
||||
|
||||
// aapt resource value: 0x7f0200ed
|
||||
public const int tools = 2130837741;
|
||||
|
||||
// aapt resource value: 0x7f0200ee
|
||||
public const int tools_selected = 2130837742;
|
||||
|
||||
// aapt resource value: 0x7f0200ef
|
||||
public const int upload = 2130837743;
|
||||
|
||||
// aapt resource value: 0x7f0200f0
|
||||
public const int user = 2130837744;
|
||||
|
||||
static Drawable()
|
||||
{
|
||||
@@ -3676,6 +3693,9 @@ namespace Bit.Android
|
||||
// aapt resource value: 0x7f080047
|
||||
public const int ApplicationName = 2131230791;
|
||||
|
||||
// aapt resource value: 0x7f08008f
|
||||
public const int AutoFillServiceDescription = 2131230863;
|
||||
|
||||
// aapt resource value: 0x7f080046
|
||||
public const int Hello = 2131230790;
|
||||
|
||||
|
||||
|
After Width: | Height: | Size: 13 KiB |
|
After Width: | Height: | Size: 7.1 KiB |
BIN
src/Android/Resources/drawable-hdpi/accessibility_step1.png
Normal file
|
After Width: | Height: | Size: 12 KiB |
BIN
src/Android/Resources/drawable-hdpi/accessibility_step2.png
Normal file
|
After Width: | Height: | Size: 7.6 KiB |
BIN
src/Android/Resources/drawable-hdpi/close.png
Normal file
|
After Width: | Height: | Size: 347 B |
BIN
src/Android/Resources/drawable-hdpi/notification_sm.png
Normal file
|
After Width: | Height: | Size: 531 B |
|
After Width: | Height: | Size: 19 KiB |
|
After Width: | Height: | Size: 9.8 KiB |
BIN
src/Android/Resources/drawable-xhdpi/accessibility_step1.png
Normal file
|
After Width: | Height: | Size: 18 KiB |
BIN
src/Android/Resources/drawable-xhdpi/accessibility_step2.png
Normal file
|
After Width: | Height: | Size: 11 KiB |
BIN
src/Android/Resources/drawable-xhdpi/close.png
Normal file
|
After Width: | Height: | Size: 404 B |
BIN
src/Android/Resources/drawable-xhdpi/notification_sm.png
Normal file
|
After Width: | Height: | Size: 586 B |
|
After Width: | Height: | Size: 21 KiB |
|
After Width: | Height: | Size: 11 KiB |
BIN
src/Android/Resources/drawable-xxhdpi/accessibility_step1.png
Normal file
|
After Width: | Height: | Size: 17 KiB |
BIN
src/Android/Resources/drawable-xxhdpi/accessibility_step2.png
Normal file
|
After Width: | Height: | Size: 12 KiB |
BIN
src/Android/Resources/drawable-xxhdpi/close.png
Normal file
|
After Width: | Height: | Size: 374 B |
BIN
src/Android/Resources/drawable-xxhdpi/notification_sm.png
Normal file
|
After Width: | Height: | Size: 773 B |
BIN
src/Android/Resources/drawable-xxxhdpi/close.png
Normal file
|
After Width: | Height: | Size: 564 B |
BIN
src/Android/Resources/drawable-xxxhdpi/notification_sm.png
Normal file
|
After Width: | Height: | Size: 1.0 KiB |
BIN
src/Android/Resources/drawable/accessibility_notification.png
Normal file
|
After Width: | Height: | Size: 8.0 KiB |
|
After Width: | Height: | Size: 4.7 KiB |
BIN
src/Android/Resources/drawable/accessibility_step1.png
Normal file
|
After Width: | Height: | Size: 7.6 KiB |
BIN
src/Android/Resources/drawable/accessibility_step2.png
Normal file
|
After Width: | Height: | Size: 4.9 KiB |
BIN
src/Android/Resources/drawable/close.png
Normal file
|
After Width: | Height: | Size: 312 B |
BIN
src/Android/Resources/drawable/notification_sm.png
Normal file
|
After Width: | Height: | Size: 364 B |
8
src/Android/Resources/values/strings.xml
Normal file
@@ -0,0 +1,8 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<resources>
|
||||
<string name="AutoFillServiceDescription">
|
||||
The allow bitwarden to auto-fill into other Android apps and on the web through your browser, enable the bitwarden
|
||||
accessibility service by tapping the toggle switch above, then press OK on the confirmation pop-up. You can then press
|
||||
the back button twice to return to the main bitwarden app.
|
||||
</string>
|
||||
</resources>
|
||||
@@ -1,7 +1,8 @@
|
||||
<?xml version="1.0" encoding="utf-8" ?>
|
||||
<accessibility-service xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
android:accessibilityEventTypes="typeViewTextSelectionChanged"
|
||||
android:accessibilityFeedbackType="feedbackAllMask"
|
||||
android:description="@string/AutoFillServiceDescription"
|
||||
android:accessibilityEventTypes="typeWindowStateChanged|typeWindowContentChanged"
|
||||
android:accessibilityFeedbackType="feedbackGeneric"
|
||||
android:accessibilityFlags="flagDefault"
|
||||
android:notificationTimeout="100"
|
||||
android:canRetrieveWindowContent="true"
|
||||
android:canRequestEnhancedWebAccessibility="true"/>
|
||||
android:canRetrieveWindowContent="true"/>
|
||||
@@ -10,5 +10,7 @@ namespace Bit.Android.Services
|
||||
|
||||
public string Build => AndroidApp.Context.ApplicationContext.PackageManager
|
||||
.GetPackageInfo(AndroidApp.Context.PackageName, 0).VersionCode.ToString();
|
||||
|
||||
public bool AutofillServiceEnabled => AutofillService.Enabled;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -44,7 +44,7 @@ namespace Bit.Android.Services
|
||||
|
||||
public void TrackExtensionEvent(string eventName, string label = null)
|
||||
{
|
||||
throw new NotSupportedException();
|
||||
TrackEvent("AutofillService", eventName, label);
|
||||
}
|
||||
|
||||
public void TrackEvent(string category, string eventName, string label = null)
|
||||
|
||||
12
src/Android/Services/HttpService.cs
Normal file
@@ -0,0 +1,12 @@
|
||||
using System;
|
||||
using Xamarin.Android.Net;
|
||||
using Bit.App;
|
||||
using Bit.App.Abstractions;
|
||||
|
||||
namespace Bit.Android.Services
|
||||
{
|
||||
public class HttpService : IHttpService
|
||||
{
|
||||
public ApiHttpClient Client => new ApiHttpClient(new CustomAndroidClientHandler());
|
||||
}
|
||||
}
|
||||
105
src/Android/Services/LocalizeService.cs
Normal file
@@ -0,0 +1,105 @@
|
||||
using System;
|
||||
using System.Threading;
|
||||
using System.Globalization;
|
||||
using Bit.App.Models;
|
||||
|
||||
namespace Bit.Android.Services
|
||||
{
|
||||
public class LocalizeService : App.Abstractions.ILocalizeService
|
||||
{
|
||||
public void SetLocale(CultureInfo ci)
|
||||
{
|
||||
Thread.CurrentThread.CurrentCulture = ci;
|
||||
Thread.CurrentThread.CurrentUICulture = ci;
|
||||
Console.WriteLine("CurrentCulture set: " + ci.Name);
|
||||
}
|
||||
|
||||
public CultureInfo GetCurrentCultureInfo()
|
||||
{
|
||||
var netLanguage = "en";
|
||||
var androidLocale = Java.Util.Locale.Default;
|
||||
netLanguage = AndroidToDotnetLanguage(androidLocale.ToString().Replace("_", "-"));
|
||||
|
||||
// this gets called a lot - try/catch can be expensive so consider caching or something
|
||||
CultureInfo ci = null;
|
||||
try
|
||||
{
|
||||
ci = new CultureInfo(netLanguage);
|
||||
}
|
||||
catch(CultureNotFoundException e1)
|
||||
{
|
||||
// iOS locale not valid .NET culture (eg. "en-ES" : English in Spain)
|
||||
// fallback to first characters, in this case "en"
|
||||
try
|
||||
{
|
||||
var fallback = ToDotnetFallbackLanguage(new PlatformCulture(netLanguage));
|
||||
Console.WriteLine(netLanguage + " failed, trying " + fallback + " (" + e1.Message + ")");
|
||||
ci = new CultureInfo(fallback);
|
||||
}
|
||||
catch(CultureNotFoundException e2)
|
||||
{
|
||||
// iOS language not valid .NET culture, falling back to English
|
||||
Console.WriteLine(netLanguage + " couldn't be set, using 'en' (" + e2.Message + ")");
|
||||
ci = new CultureInfo("en");
|
||||
}
|
||||
}
|
||||
|
||||
return ci;
|
||||
}
|
||||
|
||||
private string AndroidToDotnetLanguage(string androidLanguage)
|
||||
{
|
||||
Console.WriteLine("Android Language:" + androidLanguage);
|
||||
var netLanguage = androidLanguage;
|
||||
|
||||
if(netLanguage.StartsWith("zh"))
|
||||
{
|
||||
// simplified chinese used for all for now
|
||||
netLanguage = "zh-Hans";
|
||||
}
|
||||
else
|
||||
{
|
||||
// certain languages need to be converted to CultureInfo equivalent
|
||||
switch(androidLanguage)
|
||||
{
|
||||
case "ms-BN": // "Malaysian (Brunei)" not supported .NET culture
|
||||
case "ms-MY": // "Malaysian (Malaysia)" not supported .NET culture
|
||||
case "ms-SG": // "Malaysian (Singapore)" not supported .NET culture
|
||||
netLanguage = "ms"; // closest supported
|
||||
break;
|
||||
case "in-ID": // "Indonesian (Indonesia)" has different code in .NET
|
||||
netLanguage = "id-ID"; // correct code for .NET
|
||||
break;
|
||||
case "gsw-CH": // "Schwiizert<72><74>tsch (Swiss German)" not supported .NET culture
|
||||
netLanguage = "de-CH"; // closest supported
|
||||
break;
|
||||
// add more application-specific cases here (if required)
|
||||
// ONLY use cultures that have been tested and known to work
|
||||
}
|
||||
}
|
||||
|
||||
Console.WriteLine(".NET Language/Locale:" + netLanguage);
|
||||
return netLanguage;
|
||||
}
|
||||
|
||||
private string ToDotnetFallbackLanguage(PlatformCulture platCulture)
|
||||
{
|
||||
Console.WriteLine(".NET Fallback Language:" + platCulture.LanguageCode);
|
||||
var netLanguage = platCulture.LanguageCode; // use the first part of the identifier (two chars, usually);
|
||||
|
||||
switch(platCulture.LanguageCode)
|
||||
{
|
||||
case "gsw":
|
||||
netLanguage = "de-CH"; // equivalent to German (Switzerland) for this app
|
||||
break;
|
||||
// add more application-specific cases here (if required)
|
||||
// ONLY use cultures that have been tested and known to work
|
||||
}
|
||||
|
||||
Console.WriteLine(".NET Fallback Language/Locale:" + netLanguage + " (application-specific)");
|
||||
return netLanguage;
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
}
|
||||
13
src/Android/Services/LogService.cs
Normal file
@@ -0,0 +1,13 @@
|
||||
using System;
|
||||
using Bit.App.Abstractions;
|
||||
|
||||
namespace Bit.Android.Services
|
||||
{
|
||||
public class LogService : ILogService
|
||||
{
|
||||
public void WriteLine(string message)
|
||||
{
|
||||
Console.WriteLine(message);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -6,6 +6,10 @@
|
||||
<assemblyIdentity name="Newtonsoft.Json" publicKeyToken="30ad4fe6b2a6aeed" culture="neutral" />
|
||||
<bindingRedirect oldVersion="0.0.0.0-9.0.0.0" newVersion="9.0.0.0" />
|
||||
</dependentAssembly>
|
||||
<dependentAssembly>
|
||||
<assemblyIdentity name="Validation" publicKeyToken="2fc06f0d701809a7" culture="neutral" />
|
||||
<bindingRedirect oldVersion="0.0.0.0-2.3.0.0" newVersion="2.3.0.0" />
|
||||
</dependentAssembly>
|
||||
</assemblyBinding>
|
||||
</runtime>
|
||||
</configuration>
|
||||
8
src/Android/increment-version.ps1
Normal file
@@ -0,0 +1,8 @@
|
||||
$rootPath = $args[0];
|
||||
$newVersionCode = $args[1];
|
||||
|
||||
$xml=New-Object XML;
|
||||
$xml.Load($rootPath + "\src\Android\Properties\AndroidManifest.xml");
|
||||
$node=$xml.SelectNodes("/manifest");
|
||||
$node.SetAttribute("android:versionCode", $newVersionCode);
|
||||
$xml.Save($rootPath + "\src\Android\Properties\AndroidManifest.xml");
|
||||
@@ -1,30 +1,33 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<packages>
|
||||
<package id="Acr.Support" version="2.1.0" targetFramework="monoandroid60" />
|
||||
<package id="Acr.UserDialogs" version="6.0.1" targetFramework="monoandroid60" />
|
||||
<package id="Acr.UserDialogs" version="6.3.3" targetFramework="monoandroid60" />
|
||||
<package id="AndHUD" version="1.2.0" targetFramework="monoandroid60" />
|
||||
<package id="BouncyCastle" version="1.8.1" targetFramework="monoandroid60" />
|
||||
<package id="CommonServiceLocator" version="1.3" targetFramework="monoandroid60" />
|
||||
<package id="HockeySDK.Xamarin" version="4.1.0-beta3" targetFramework="monoandroid60" />
|
||||
<package id="modernhttpclient" version="2.4.2" targetFramework="monoandroid50" />
|
||||
<package id="HockeySDK.Xamarin" version="4.1.0" targetFramework="monoandroid60" />
|
||||
<package id="Newtonsoft.Json" version="9.0.1" targetFramework="monoandroid60" />
|
||||
<package id="PCLCrypto" version="2.0.147" targetFramework="monoandroid60" />
|
||||
<package id="PInvoke.BCrypt" version="0.3.2" targetFramework="monoandroid60" />
|
||||
<package id="PInvoke.Kernel32" version="0.3.2" targetFramework="monoandroid60" />
|
||||
<package id="PInvoke.NCrypt" version="0.3.2" targetFramework="monoandroid60" />
|
||||
<package id="PInvoke.Windows.Core" version="0.3.2" targetFramework="monoandroid60" />
|
||||
<package id="PInvoke.BCrypt" version="0.3.152" targetFramework="monoandroid60" />
|
||||
<package id="PInvoke.Kernel32" version="0.3.152" targetFramework="monoandroid60" />
|
||||
<package id="PInvoke.NCrypt" version="0.3.152" targetFramework="monoandroid60" />
|
||||
<package id="PInvoke.Windows.Core" version="0.3.152" targetFramework="monoandroid60" />
|
||||
<package id="Plugin.CurrentActivity" version="1.0.1" targetFramework="monoandroid60" />
|
||||
<package id="Plugin.Fingerprint" version="1.2.0" targetFramework="monoandroid60" />
|
||||
<package id="Splat" version="1.6.2" targetFramework="monoandroid60" />
|
||||
<package id="sqlite-net-pcl" version="1.1.2" targetFramework="monoandroid60" />
|
||||
<package id="sqlite-net-pcl" version="1.2.1" targetFramework="monoandroid60" />
|
||||
<package id="SQLitePCL.bundle_green" version="0.9.3" targetFramework="monoandroid60" />
|
||||
<package id="SQLitePCL.plugin.sqlite3.android" version="0.9.3" targetFramework="monoandroid60" />
|
||||
<package id="SQLitePCL.raw" version="0.9.3" targetFramework="monoandroid60" />
|
||||
<package id="SQLitePCLRaw.bundle_green" version="1.1.2" targetFramework="monoandroid60" />
|
||||
<package id="SQLitePCLRaw.core" version="1.1.2" targetFramework="monoandroid60" />
|
||||
<package id="SQLitePCLRaw.lib.e_sqlite3.android" version="1.1.2" targetFramework="monoandroid60" />
|
||||
<package id="SQLitePCLRaw.provider.e_sqlite3.android" version="1.1.2" targetFramework="monoandroid60" />
|
||||
<package id="Unity" version="3.5.1405-prerelease" targetFramework="monoandroid60" />
|
||||
<package id="Validation" version="2.2.8" targetFramework="monoandroid60" />
|
||||
<package id="Validation" version="2.3.7" targetFramework="monoandroid60" />
|
||||
<package id="Xam.Plugin.Connectivity" version="2.2.12" targetFramework="monoandroid60" />
|
||||
<package id="Xam.Plugin.PushNotification" version="1.2.2" targetFramework="monoandroid60" developmentDependency="true" />
|
||||
<package id="Xam.Plugins.Settings" version="2.1.0" targetFramework="monoandroid60" />
|
||||
<package id="Xam.Plugin.PushNotification" version="1.2.4" targetFramework="monoandroid60" developmentDependency="true" />
|
||||
<package id="Xam.Plugins.Settings" version="2.5.1.0" targetFramework="monoandroid60" />
|
||||
<package id="Xamarin.Android.Support.Animated.Vector.Drawable" version="23.3.0" targetFramework="monoandroid60" />
|
||||
<package id="Xamarin.Android.Support.Design" version="23.3.0" targetFramework="monoandroid60" />
|
||||
<package id="Xamarin.Android.Support.v4" version="23.3.0" targetFramework="monoandroid60" />
|
||||
@@ -33,7 +36,7 @@
|
||||
<package id="Xamarin.Android.Support.v7.MediaRouter" version="23.3.0" targetFramework="monoandroid60" />
|
||||
<package id="Xamarin.Android.Support.v7.RecyclerView" version="23.3.0" targetFramework="monoandroid60" />
|
||||
<package id="Xamarin.Android.Support.Vector.Drawable" version="23.3.0" targetFramework="monoandroid60" />
|
||||
<package id="Xamarin.Forms" version="2.3.2.127" targetFramework="monoandroid60" />
|
||||
<package id="Xamarin.Forms" version="2.3.3.180" targetFramework="monoandroid60" />
|
||||
<package id="Xamarin.GooglePlayServices.Analytics" version="29.0.0.2" targetFramework="monoandroid60" />
|
||||
<package id="Xamarin.GooglePlayServices.Base" version="29.0.0.2" targetFramework="monoandroid60" />
|
||||
<package id="Xamarin.GooglePlayServices.Basement" version="29.0.0.2" targetFramework="monoandroid60" />
|
||||
|
||||
@@ -1,5 +1,6 @@
|
||||
using System.Threading.Tasks;
|
||||
using Bit.App.Models.Api;
|
||||
using System;
|
||||
|
||||
namespace Bit.App.Abstractions
|
||||
{
|
||||
@@ -7,5 +8,6 @@ namespace Bit.App.Abstractions
|
||||
{
|
||||
Task<ApiResult> PostRegisterAsync(RegisterRequest requestObj);
|
||||
Task<ApiResult> PostPasswordHintAsync(PasswordHintRequest requestObj);
|
||||
Task<ApiResult<DateTime?>> GetAccountRevisionDate();
|
||||
}
|
||||
}
|
||||
@@ -3,9 +3,8 @@ using Bit.App.Models.Api;
|
||||
|
||||
namespace Bit.App.Abstractions
|
||||
{
|
||||
public interface IAuthApiRepository
|
||||
public interface IConnectApiRepository
|
||||
{
|
||||
Task<ApiResult<TokenResponse>> PostTokenAsync(TokenRequest requestObj);
|
||||
Task<ApiResult<TokenResponse>> PostTokenTwoFactorAsync(TokenTwoFactorRequest requestObj);
|
||||
}
|
||||
}
|
||||
@@ -8,6 +8,6 @@ namespace Bit.App.Abstractions
|
||||
public interface IFolderRepository : IRepository<FolderData, string>
|
||||
{
|
||||
Task<IEnumerable<FolderData>> GetAllByUserIdAsync(string userId);
|
||||
Task DeleteWithSiteUpdateAsync(string id, DateTime revisionDate);
|
||||
Task DeleteWithLoginUpdateAsync(string id, DateTime revisionDate);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -5,7 +5,7 @@ using Bit.App.Models.Api;
|
||||
|
||||
namespace Bit.App.Abstractions
|
||||
{
|
||||
public interface ISiteApiRepository : IApiRepository<SiteRequest, SiteResponse, string>
|
||||
public interface ILoginApiRepository : IApiRepository<LoginRequest, LoginResponse, string>
|
||||
{
|
||||
}
|
||||
}
|
||||
13
src/App/Abstractions/Repositories/ILoginRepository.cs
Normal file
@@ -0,0 +1,13 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Threading.Tasks;
|
||||
using Bit.App.Models.Data;
|
||||
|
||||
namespace Bit.App.Abstractions
|
||||
{
|
||||
public interface ILoginRepository : IRepository<LoginData, string>
|
||||
{
|
||||
Task<IEnumerable<LoginData>> GetAllByUserIdAsync(string userId);
|
||||
Task<IEnumerable<LoginData>> GetAllByUserIdAsync(string userId, bool favorite);
|
||||
}
|
||||
}
|
||||
@@ -12,6 +12,7 @@ namespace Bit.App.Abstractions
|
||||
Task<IEnumerable<T>> GetAllAsync();
|
||||
Task UpdateAsync(T obj);
|
||||
Task InsertAsync(T obj);
|
||||
Task UpsertAsync(T obj);
|
||||
Task DeleteAsync(TId id);
|
||||
Task DeleteAsync(T obj);
|
||||
}
|
||||
|
||||
10
src/App/Abstractions/Repositories/ISettingsApiRepository.cs
Normal file
@@ -0,0 +1,10 @@
|
||||
using System.Threading.Tasks;
|
||||
using Bit.App.Models.Api;
|
||||
|
||||
namespace Bit.App.Abstractions
|
||||
{
|
||||
public interface ISettingsApiRepository
|
||||
{
|
||||
Task<ApiResult<DomainsResponse>> GetDomains(bool excluded = false);
|
||||
}
|
||||
}
|
||||
8
src/App/Abstractions/Repositories/ISettingsRepository.cs
Normal file
@@ -0,0 +1,8 @@
|
||||
using Bit.App.Models.Data;
|
||||
|
||||
namespace Bit.App.Abstractions
|
||||
{
|
||||
public interface ISettingsRepository : IRepository<SettingsData, string>
|
||||
{
|
||||
}
|
||||
}
|
||||
@@ -1,13 +0,0 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Threading.Tasks;
|
||||
using Bit.App.Models.Data;
|
||||
|
||||
namespace Bit.App.Abstractions
|
||||
{
|
||||
public interface ISiteRepository : IRepository<SiteData, string>
|
||||
{
|
||||
Task<IEnumerable<SiteData>> GetAllByUserIdAsync(string userId);
|
||||
Task<IEnumerable<SiteData>> GetAllByUserIdAsync(string userId, bool favorite);
|
||||
}
|
||||
}
|
||||
@@ -4,5 +4,6 @@
|
||||
{
|
||||
string Build { get; }
|
||||
string Version { get; }
|
||||
bool AutofillServiceEnabled { get; }
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,13 +1,12 @@
|
||||
using System.Threading.Tasks;
|
||||
using Bit.App.Models.Api;
|
||||
using System;
|
||||
|
||||
namespace Bit.App.Abstractions
|
||||
{
|
||||
public interface IAuthService
|
||||
{
|
||||
bool IsAuthenticated { get; }
|
||||
bool IsAuthenticatedTwoFactor { get; }
|
||||
string Token { get; set; }
|
||||
string UserId { get; set; }
|
||||
string PreviousUserId { get; }
|
||||
bool UserIdChanged { get; }
|
||||
@@ -16,6 +15,5 @@ namespace Bit.App.Abstractions
|
||||
|
||||
void LogOut();
|
||||
Task<ApiResult<TokenResponse>> TokenPostAsync(TokenRequest request);
|
||||
Task<ApiResult<TokenResponse>> TokenTwoFactorPostAsync(TokenTwoFactorRequest request);
|
||||
}
|
||||
}
|
||||
|
||||
7
src/App/Abstractions/Services/IHttpService.cs
Normal file
@@ -0,0 +1,7 @@
|
||||
namespace Bit.App.Abstractions
|
||||
{
|
||||
public interface IHttpService
|
||||
{
|
||||
ApiHttpClient Client { get; }
|
||||
}
|
||||
}
|
||||
31
src/App/Abstractions/Services/ILocalizeService.cs
Normal file
@@ -0,0 +1,31 @@
|
||||
using System;
|
||||
using System.Globalization;
|
||||
|
||||
namespace Bit.App.Abstractions
|
||||
{
|
||||
/// <summary>
|
||||
/// Implementations of this interface MUST convert iOS and Android
|
||||
/// platform-specific locales to a value supported in .NET because
|
||||
/// ONLY valid .NET cultures can have their RESX resources loaded and used.
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// Lists of valid .NET cultures can be found here:
|
||||
/// http://www.localeplanet.com/dotnet/
|
||||
/// http://www.csharp-examples.net/culture-names/
|
||||
/// You should always test all the locales implemented in your application.
|
||||
/// </remarks>
|
||||
public interface ILocalizeService
|
||||
{
|
||||
/// <summary>
|
||||
/// This method must evaluate platform-specific locale settings
|
||||
/// and convert them (when necessary) to a valid .NET locale.
|
||||
/// </summary>
|
||||
CultureInfo GetCurrentCultureInfo();
|
||||
|
||||
/// <summary>
|
||||
/// CurrentCulture and CurrentUICulture must be set in the platform project,
|
||||
/// because the Thread object can't be accessed in a PCL.
|
||||
/// </summary>
|
||||
void SetLocale(CultureInfo ci);
|
||||
}
|
||||
}
|
||||
7
src/App/Abstractions/Services/ILogService.cs
Normal file
@@ -0,0 +1,7 @@
|
||||
namespace Bit.App.Abstractions
|
||||
{
|
||||
public interface ILogService
|
||||
{
|
||||
void WriteLine(string message);
|
||||
}
|
||||
}
|
||||
17
src/App/Abstractions/Services/ILoginService.cs
Normal file
@@ -0,0 +1,17 @@
|
||||
using System.Collections.Generic;
|
||||
using System.Threading.Tasks;
|
||||
using Bit.App.Models;
|
||||
using Bit.App.Models.Api;
|
||||
|
||||
namespace Bit.App.Abstractions
|
||||
{
|
||||
public interface ILoginService
|
||||
{
|
||||
Task<Login> GetByIdAsync(string id);
|
||||
Task<IEnumerable<Login>> GetAllAsync();
|
||||
Task<IEnumerable<Login>> GetAllAsync(bool favorites);
|
||||
Task<IEnumerable<Login>> GetAllAsync(string uriString);
|
||||
Task<ApiResult<LoginResponse>> SaveAsync(Login login);
|
||||
Task<ApiResult> DeleteAsync(string id);
|
||||
}
|
||||
}
|
||||
10
src/App/Abstractions/Services/ISettingsService.cs
Normal file
@@ -0,0 +1,10 @@
|
||||
using System.Collections.Generic;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
namespace Bit.App.Abstractions
|
||||
{
|
||||
public interface ISettingsService
|
||||
{
|
||||
Task<IEnumerable<IEnumerable<string>>> GetEquivalentDomainsAsync();
|
||||
}
|
||||
}
|
||||
@@ -1,16 +0,0 @@
|
||||
using System.Collections.Generic;
|
||||
using System.Threading.Tasks;
|
||||
using Bit.App.Models;
|
||||
using Bit.App.Models.Api;
|
||||
|
||||
namespace Bit.App.Abstractions
|
||||
{
|
||||
public interface ISiteService
|
||||
{
|
||||
Task<Site> GetByIdAsync(string id);
|
||||
Task<IEnumerable<Site>> GetAllAsync();
|
||||
Task<IEnumerable<Site>> GetAllAsync(bool favorites);
|
||||
Task<ApiResult<SiteResponse>> SaveAsync(Site site);
|
||||
Task<ApiResult> DeleteAsync(string id);
|
||||
}
|
||||
}
|
||||
@@ -8,9 +8,8 @@ namespace Bit.App.Abstractions
|
||||
bool SyncInProgress { get; }
|
||||
Task<bool> SyncAsync(string id);
|
||||
Task<bool> SyncDeleteFolderAsync(string id, DateTime revisionDate);
|
||||
Task<bool> SyncDeleteSiteAsync(string id);
|
||||
Task<bool> FullSyncAsync();
|
||||
Task<bool> IncrementalSyncAsync(TimeSpan syncThreshold);
|
||||
Task<bool> IncrementalSyncAsync();
|
||||
Task<bool> SyncDeleteLoginAsync(string id);
|
||||
Task<bool> FullSyncAsync(bool forceSync = false);
|
||||
Task<bool> FullSyncAsync(TimeSpan syncThreshold, bool forceSync = false);
|
||||
}
|
||||
}
|
||||
|
||||
19
src/App/Abstractions/Services/ITokenService.cs
Normal file
@@ -0,0 +1,19 @@
|
||||
using System;
|
||||
|
||||
namespace Bit.App.Abstractions
|
||||
{
|
||||
public interface ITokenService
|
||||
{
|
||||
string Token { get; set; }
|
||||
string RefreshToken { get; set; }
|
||||
[Obsolete("Old auth scheme")]
|
||||
string AuthBearer { get; set; }
|
||||
DateTime TokenExpiration { get; }
|
||||
bool TokenExpired { get; }
|
||||
TimeSpan TokenTimeRemaining { get; }
|
||||
bool TokenNeedsRefresh { get; }
|
||||
string TokenUserId { get; }
|
||||
string TokenEmail { get; }
|
||||
string TokenName { get; }
|
||||
}
|
||||
}
|
||||
119
src/App/App.cs
@@ -12,11 +12,17 @@ using Plugin.Connectivity.Abstractions;
|
||||
using System.Net;
|
||||
using Acr.UserDialogs;
|
||||
using XLabs.Ioc;
|
||||
using System.Reflection;
|
||||
using Bit.App.Resources;
|
||||
using System.Threading;
|
||||
|
||||
namespace Bit.App
|
||||
{
|
||||
public class App : Application
|
||||
{
|
||||
private const string LastBuildKey = "LastBuild";
|
||||
|
||||
private string _uri;
|
||||
private readonly IDatabaseService _databaseService;
|
||||
private readonly IConnectivity _connectivity;
|
||||
private readonly IUserDialogs _userDialogs;
|
||||
@@ -26,8 +32,11 @@ namespace Bit.App
|
||||
private readonly ISettings _settings;
|
||||
private readonly ILockService _lockService;
|
||||
private readonly IGoogleAnalyticsService _googleAnalyticsService;
|
||||
private readonly ILocalizeService _localizeService;
|
||||
private readonly IAppInfoService _appInfoService;
|
||||
|
||||
public App(
|
||||
string uri,
|
||||
IAuthService authService,
|
||||
IConnectivity connectivity,
|
||||
IUserDialogs userDialogs,
|
||||
@@ -36,8 +45,11 @@ namespace Bit.App
|
||||
IFingerprint fingerprint,
|
||||
ISettings settings,
|
||||
ILockService lockService,
|
||||
IGoogleAnalyticsService googleAnalyticsService)
|
||||
IGoogleAnalyticsService googleAnalyticsService,
|
||||
ILocalizeService localizeService,
|
||||
IAppInfoService appInfoService)
|
||||
{
|
||||
_uri = uri;
|
||||
_databaseService = databaseService;
|
||||
_connectivity = connectivity;
|
||||
_userDialogs = userDialogs;
|
||||
@@ -47,10 +59,17 @@ namespace Bit.App
|
||||
_settings = settings;
|
||||
_lockService = lockService;
|
||||
_googleAnalyticsService = googleAnalyticsService;
|
||||
_localizeService = localizeService;
|
||||
_appInfoService = appInfoService;
|
||||
|
||||
SetCulture();
|
||||
SetStyles();
|
||||
|
||||
if(authService.IsAuthenticated)
|
||||
if(authService.IsAuthenticated && _uri != null)
|
||||
{
|
||||
MainPage = new ExtendedNavigationPage(new VaultAutofillListLoginsPage(_uri));
|
||||
}
|
||||
else if(authService.IsAuthenticated)
|
||||
{
|
||||
MainPage = new MainPage();
|
||||
}
|
||||
@@ -62,7 +81,7 @@ namespace Bit.App
|
||||
MessagingCenter.Subscribe<Application, bool>(Current, "Resumed", async (sender, args) =>
|
||||
{
|
||||
await CheckLockAsync(args);
|
||||
await Task.Run(() => IncrementalSyncAsync()).ConfigureAwait(false);
|
||||
await Task.Run(() => FullSyncAsync()).ConfigureAwait(false);
|
||||
});
|
||||
|
||||
MessagingCenter.Subscribe<Application, bool>(Current, "Lock", (sender, args) =>
|
||||
@@ -74,14 +93,29 @@ namespace Bit.App
|
||||
{
|
||||
Device.BeginInvokeOnMainThread(() => Logout(args));
|
||||
});
|
||||
|
||||
MessagingCenter.Subscribe<Application>(Current, "SetMainPage", (sender) =>
|
||||
{
|
||||
SetMainPageFromAutofill();
|
||||
});
|
||||
}
|
||||
|
||||
protected async override void OnStart()
|
||||
{
|
||||
// Handle when your app starts
|
||||
await CheckLockAsync(false);
|
||||
_databaseService.CreateTables();
|
||||
await Task.Run(() => FullSyncAsync()).ConfigureAwait(false);
|
||||
|
||||
if(string.IsNullOrWhiteSpace(_uri))
|
||||
{
|
||||
var lastBuild = _settings.GetValueOrDefault<string>(LastBuildKey);
|
||||
if(InDebugMode() || lastBuild == null || lastBuild != _appInfoService.Build)
|
||||
{
|
||||
_settings.AddOrUpdateValue(LastBuildKey, _appInfoService.Build);
|
||||
_databaseService.CreateTables();
|
||||
}
|
||||
|
||||
await Task.Run(() => FullSyncAsync()).ConfigureAwait(false);
|
||||
}
|
||||
|
||||
Debug.WriteLine("OnStart");
|
||||
}
|
||||
@@ -91,6 +125,7 @@ namespace Bit.App
|
||||
// Handle when your app sleeps
|
||||
Debug.WriteLine("OnSleep");
|
||||
|
||||
SetMainPageFromAutofill();
|
||||
if(Device.OS == TargetPlatform.Android && !TopPageIsLock())
|
||||
{
|
||||
_settings.AddOrUpdateValue(Constants.LastActivityDate, DateTime.UtcNow);
|
||||
@@ -118,44 +153,31 @@ namespace Bit.App
|
||||
{
|
||||
lockPinPage.PinControl.Entry.FocusWithDelay();
|
||||
}
|
||||
|
||||
if(Device.OS == TargetPlatform.Android)
|
||||
{
|
||||
await Task.Run(() => FullSyncAsync()).ConfigureAwait(false);
|
||||
}
|
||||
}
|
||||
|
||||
private async Task IncrementalSyncAsync()
|
||||
private bool InDebugMode()
|
||||
{
|
||||
if(_connectivity.IsConnected)
|
||||
#if DEBUG
|
||||
return true;
|
||||
#else
|
||||
return false;
|
||||
#endif
|
||||
}
|
||||
|
||||
private void SetMainPageFromAutofill()
|
||||
{
|
||||
if(Device.OS != TargetPlatform.Android || string.IsNullOrWhiteSpace(_uri))
|
||||
{
|
||||
var attempt = 0;
|
||||
do
|
||||
{
|
||||
try
|
||||
{
|
||||
await _syncService.IncrementalSyncAsync(TimeSpan.FromMinutes(30)).ConfigureAwait(false);
|
||||
break;
|
||||
}
|
||||
catch(WebException)
|
||||
{
|
||||
Debug.WriteLine("Failed to incremental sync.");
|
||||
if(attempt >= 1)
|
||||
{
|
||||
break;
|
||||
}
|
||||
else
|
||||
{
|
||||
await Task.Delay(1000);
|
||||
}
|
||||
attempt++;
|
||||
}
|
||||
catch(Exception e) when(e is TaskCanceledException || e is OperationCanceledException)
|
||||
{
|
||||
Debug.WriteLine("Cancellation exception.");
|
||||
break;
|
||||
}
|
||||
} while(attempt <= 1);
|
||||
}
|
||||
else
|
||||
{
|
||||
Debug.WriteLine("Not connected.");
|
||||
return;
|
||||
}
|
||||
|
||||
MainPage = new MainPage();
|
||||
_uri = null;
|
||||
}
|
||||
|
||||
private async Task FullSyncAsync()
|
||||
@@ -167,7 +189,7 @@ namespace Bit.App
|
||||
{
|
||||
try
|
||||
{
|
||||
await _syncService.FullSyncAsync().ConfigureAwait(false);
|
||||
await _syncService.FullSyncAsync(TimeSpan.FromMinutes(30)).ConfigureAwait(false);
|
||||
break;
|
||||
}
|
||||
catch(WebException)
|
||||
@@ -347,5 +369,24 @@ namespace Bit.App
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
private void SetCulture()
|
||||
{
|
||||
Debug.WriteLine("====== resource debug info =========");
|
||||
var assembly = typeof(App).GetTypeInfo().Assembly;
|
||||
foreach(var res in assembly.GetManifestResourceNames())
|
||||
{
|
||||
Debug.WriteLine("found resource: " + res);
|
||||
}
|
||||
Debug.WriteLine("====================================");
|
||||
|
||||
// This lookup NOT required for Windows platforms - the Culture will be automatically set
|
||||
if(Device.OS == TargetPlatform.iOS || Device.OS == TargetPlatform.Android)
|
||||
{
|
||||
var ci = _localizeService.GetCurrentCultureInfo();
|
||||
AppResources.Culture = ci;
|
||||
_localizeService.SetLocale(ci);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -35,8 +35,13 @@
|
||||
<WarningLevel>4</WarningLevel>
|
||||
</PropertyGroup>
|
||||
<ItemGroup>
|
||||
<Compile Include="Abstractions\Repositories\ISettingsApiRepository.cs" />
|
||||
<Compile Include="Abstractions\Repositories\IAccountsApiRepository.cs" />
|
||||
<Compile Include="Abstractions\Repositories\IDeviceApiRepository.cs" />
|
||||
<Compile Include="Abstractions\Repositories\ISettingsRepository.cs" />
|
||||
<Compile Include="Abstractions\Services\ISettingsService.cs" />
|
||||
<Compile Include="Abstractions\Services\ITokenService.cs" />
|
||||
<Compile Include="Abstractions\Services\IHttpService.cs" />
|
||||
<Compile Include="Abstractions\Services\IDeviceInfoService.cs" />
|
||||
<Compile Include="Abstractions\Services\IGoogleAnalyticsService.cs" />
|
||||
<Compile Include="Abstractions\Services\IAppInfoService.cs" />
|
||||
@@ -44,15 +49,13 @@
|
||||
<Compile Include="Abstractions\Services\IAuthService.cs" />
|
||||
<Compile Include="Abstractions\Services\IClipboardService.cs" />
|
||||
<Compile Include="Abstractions\Services\IKeyDerivationService.cs" />
|
||||
<Compile Include="Abstractions\Services\ILogService.cs" />
|
||||
<Compile Include="Abstractions\Services\IReflectionService.cs" />
|
||||
<Compile Include="Abstractions\Services\ISiteService.cs" />
|
||||
<Compile Include="Abstractions\Services\ILoginService.cs" />
|
||||
<Compile Include="Abstractions\Services\IFolderService.cs" />
|
||||
<Compile Include="App.cs" />
|
||||
<Compile Include="Abstractions\Services\ISecureStorageService.cs" />
|
||||
<Compile Include="Abstractions\Services\ISqlService.cs" />
|
||||
<Compile Include="Behaviors\EmailValidationBehavior.cs" />
|
||||
<Compile Include="Behaviors\ConnectivityBehavior.cs" />
|
||||
<Compile Include="Behaviors\RequiredValidationBehavior.cs" />
|
||||
<Compile Include="Constants.cs" />
|
||||
<Compile Include="Controls\DismissModalToolBarItem.cs" />
|
||||
<Compile Include="Controls\ExtendedEditor.cs" />
|
||||
@@ -73,10 +76,12 @@
|
||||
<Compile Include="Controls\FormPickerCell.cs" />
|
||||
<Compile Include="Controls\FormEntryCell.cs" />
|
||||
<Compile Include="Controls\PinControl.cs" />
|
||||
<Compile Include="Controls\VaultListViewCell.cs" />
|
||||
<Compile Include="Enums\LockType.cs" />
|
||||
<Compile Include="Enums\CipherType.cs" />
|
||||
<Compile Include="Enums\PushType.cs" />
|
||||
<Compile Include="Enums\ReturnType.cs" />
|
||||
<Compile Include="Abstractions\Services\ILocalizeService.cs" />
|
||||
<Compile Include="Models\Api\ApiError.cs" />
|
||||
<Compile Include="Models\Api\ApiResult.cs" />
|
||||
<Compile Include="Models\Api\FolderDataModel.cs" />
|
||||
@@ -84,35 +89,38 @@
|
||||
<Compile Include="Models\Api\Request\FolderRequest.cs" />
|
||||
<Compile Include="Models\Api\Request\DeviceRequest.cs" />
|
||||
<Compile Include="Models\Api\Request\RegisterRequest.cs" />
|
||||
<Compile Include="Models\Api\Request\SiteRequest.cs" />
|
||||
<Compile Include="Models\Api\Request\LoginRequest.cs" />
|
||||
<Compile Include="Models\Api\Request\PasswordHintRequest.cs" />
|
||||
<Compile Include="Models\Api\Request\TokenRequest.cs" />
|
||||
<Compile Include="Models\Api\Request\TokenTwoFactorRequest.cs" />
|
||||
<Compile Include="Models\Api\Response\CipherHistoryResponse.cs" />
|
||||
<Compile Include="Models\Api\Response\CipherResponse.cs" />
|
||||
<Compile Include="Models\Api\Response\DomainsResponse.cs" />
|
||||
<Compile Include="Models\Api\Response\ErrorResponse.cs" />
|
||||
<Compile Include="Models\Api\Response\FolderResponse.cs" />
|
||||
<Compile Include="Models\Api\Response\ListResponse.cs" />
|
||||
<Compile Include="Models\Api\Response\DeviceResponse.cs" />
|
||||
<Compile Include="Models\Api\Response\SiteResponse.cs" />
|
||||
<Compile Include="Models\Api\Response\LoginResponse.cs" />
|
||||
<Compile Include="Models\Api\Response\TokenResponse.cs" />
|
||||
<Compile Include="Models\Api\Response\ProfileResponse.cs" />
|
||||
<Compile Include="Models\Api\SiteDataModel.cs" />
|
||||
<Compile Include="Models\Api\LoginDataModel.cs" />
|
||||
<Compile Include="Models\Cipher.cs" />
|
||||
<Compile Include="Models\CipherString.cs" />
|
||||
<Compile Include="Models\Data\SettingsData.cs" />
|
||||
<Compile Include="Models\Data\FolderData.cs" />
|
||||
<Compile Include="Abstractions\IDataObject.cs" />
|
||||
<Compile Include="Models\Data\SiteData.cs" />
|
||||
<Compile Include="Models\Data\LoginData.cs" />
|
||||
<Compile Include="Models\DomainName.cs" />
|
||||
<Compile Include="Models\Folder.cs" />
|
||||
<Compile Include="Models\Page\AppExtensionPageModel.cs" />
|
||||
<Compile Include="Models\Page\SettingsFolderPageModel.cs" />
|
||||
<Compile Include="Models\Page\PinPageModel.cs" />
|
||||
<Compile Include="Models\Page\PasswordGeneratorPageModel.cs" />
|
||||
<Compile Include="Models\PlatformCulture.cs" />
|
||||
<Compile Include="Models\PushNotification.cs" />
|
||||
<Compile Include="Models\Site.cs" />
|
||||
<Compile Include="Models\Page\VaultViewSitePageModel.cs" />
|
||||
<Compile Include="Models\Login.cs" />
|
||||
<Compile Include="Models\Page\VaultViewLoginPageModel.cs" />
|
||||
<Compile Include="Pages\HomePage.cs" />
|
||||
<Compile Include="Pages\Lock\BaseLockPage.cs" />
|
||||
<Compile Include="Pages\Lock\LockPasswordPage.cs" />
|
||||
<Compile Include="Pages\LoginTwoFactorPage.cs" />
|
||||
<Compile Include="Pages\PasswordHintPage.cs" />
|
||||
@@ -133,22 +141,25 @@
|
||||
<Compile Include="Pages\Settings\SettingsSyncPage.cs" />
|
||||
<Compile Include="Pages\Settings\SettingsPage.cs" />
|
||||
<Compile Include="Pages\Settings\SettingsListFoldersPage.cs" />
|
||||
<Compile Include="Pages\Vault\VaultAutofillListLoginsPage.cs" />
|
||||
<Compile Include="Properties\AssemblyInfo.cs" />
|
||||
<Compile Include="Abstractions\Repositories\ISiteRepository.cs" />
|
||||
<Compile Include="Abstractions\Repositories\ILoginRepository.cs" />
|
||||
<Compile Include="Repositories\SettingsApiRepository.cs" />
|
||||
<Compile Include="Repositories\ApiRepository.cs" />
|
||||
<Compile Include="Repositories\AccountsApiRepository.cs" />
|
||||
<Compile Include="Repositories\ConnectApiRepository.cs" />
|
||||
<Compile Include="Repositories\BaseApiRepository.cs" />
|
||||
<Compile Include="Abstractions\Repositories\IApiRepository.cs" />
|
||||
<Compile Include="Abstractions\Repositories\IFolderApiRepository.cs" />
|
||||
<Compile Include="Abstractions\Repositories\ISiteApiRepository.cs" />
|
||||
<Compile Include="Repositories\AuthApiRepository.cs" />
|
||||
<Compile Include="Abstractions\Repositories\IAuthApiRepository.cs" />
|
||||
<Compile Include="Abstractions\Repositories\ILoginApiRepository.cs" />
|
||||
<Compile Include="Abstractions\Repositories\IConnectApiRepository.cs" />
|
||||
<Compile Include="Repositories\DeviceApiRepository.cs" />
|
||||
<Compile Include="Repositories\CipherApiRepository.cs" />
|
||||
<Compile Include="Abstractions\Repositories\ICipherApiRepository.cs" />
|
||||
<Compile Include="Repositories\SiteApiRepository.cs" />
|
||||
<Compile Include="Repositories\SettingsRepository.cs" />
|
||||
<Compile Include="Repositories\LoginApiRepository.cs" />
|
||||
<Compile Include="Repositories\FolderApiRepository.cs" />
|
||||
<Compile Include="Repositories\SiteRepository.cs" />
|
||||
<Compile Include="Repositories\LoginRepository.cs" />
|
||||
<Compile Include="Repositories\FolderRepository.cs" />
|
||||
<Compile Include="Abstractions\Repositories\IFolderRepository.cs" />
|
||||
<Compile Include="Abstractions\Repositories\IRepository.cs" />
|
||||
@@ -157,6 +168,33 @@
|
||||
<DesignTime>True</DesignTime>
|
||||
<DependentUpon>AppResources.resx</DependentUpon>
|
||||
</Compile>
|
||||
<Compile Include="Resources\AppResources.es.Designer.cs">
|
||||
<AutoGen>True</AutoGen>
|
||||
<DesignTime>True</DesignTime>
|
||||
<DependentUpon>AppResources.es.resx</DependentUpon>
|
||||
</Compile>
|
||||
<Compile Include="Resources\AppResources.fi.Designer.cs">
|
||||
<AutoGen>True</AutoGen>
|
||||
<DesignTime>True</DesignTime>
|
||||
<DependentUpon>AppResources.fi.resx</DependentUpon>
|
||||
</Compile>
|
||||
<Compile Include="Resources\AppResources.fr.Designer.cs">
|
||||
<AutoGen>True</AutoGen>
|
||||
<DesignTime>True</DesignTime>
|
||||
<DependentUpon>AppResources.fr.resx</DependentUpon>
|
||||
</Compile>
|
||||
<Compile Include="Resources\AppResources.sv.Designer.cs">
|
||||
<AutoGen>True</AutoGen>
|
||||
<DesignTime>True</DesignTime>
|
||||
<DependentUpon>AppResources.sv.resx</DependentUpon>
|
||||
</Compile>
|
||||
<Compile Include="Resources\AppResources.zh-Hans.Designer.cs">
|
||||
<AutoGen>True</AutoGen>
|
||||
<DesignTime>True</DesignTime>
|
||||
<DependentUpon>AppResources.zh-Hans.resx</DependentUpon>
|
||||
</Compile>
|
||||
<Compile Include="Services\SettingsService.cs" />
|
||||
<Compile Include="Services\TokenService.cs" />
|
||||
<Compile Include="Services\AppIdService.cs" />
|
||||
<Compile Include="Abstractions\Services\ILockService.cs" />
|
||||
<Compile Include="Services\LockService.cs" />
|
||||
@@ -168,16 +206,16 @@
|
||||
<Compile Include="Abstractions\Services\ISyncService.cs" />
|
||||
<Compile Include="Abstractions\Services\IPasswordGenerationService.cs" />
|
||||
<Compile Include="Services\SyncService.cs" />
|
||||
<Compile Include="Services\SiteService.cs" />
|
||||
<Compile Include="Services\LoginService.cs" />
|
||||
<Compile Include="Services\AuthService.cs" />
|
||||
<Compile Include="Services\CryptoService.cs" />
|
||||
<Compile Include="Models\Page\VaultListPageModel.cs" />
|
||||
<Compile Include="Pages\LoginPage.cs" />
|
||||
<Compile Include="Pages\Settings\SettingsAddFolderPage.cs" />
|
||||
<Compile Include="Pages\Vault\VaultAddSitePage.cs" />
|
||||
<Compile Include="Pages\Vault\VaultViewSitePage.cs" />
|
||||
<Compile Include="Pages\Vault\VaultEditSitePage.cs" />
|
||||
<Compile Include="Pages\Vault\VaultListSitesPage.cs" />
|
||||
<Compile Include="Pages\Vault\VaultAddLoginPage.cs" />
|
||||
<Compile Include="Pages\Vault\VaultViewLoginPage.cs" />
|
||||
<Compile Include="Pages\Vault\VaultEditLoginPage.cs" />
|
||||
<Compile Include="Pages\Vault\VaultListLoginsPage.cs" />
|
||||
<Compile Include="Services\PasswordGenerationService.cs" />
|
||||
<Compile Include="Utilities\Extentions.cs" />
|
||||
<Compile Include="Utilities\ExtendedObservableCollection.cs" />
|
||||
@@ -189,19 +227,39 @@
|
||||
<None Include="packages.config">
|
||||
<SubType>Designer</SubType>
|
||||
</None>
|
||||
<EmbeddedResource Include="Resources\AppResources.es.resx">
|
||||
<Generator>PublicResXFileCodeGenerator</Generator>
|
||||
<LastGenOutput>AppResources.es.Designer.cs</LastGenOutput>
|
||||
</EmbeddedResource>
|
||||
<EmbeddedResource Include="Resources\AppResources.fi.resx">
|
||||
<Generator>ResXFileCodeGenerator</Generator>
|
||||
<LastGenOutput>AppResources.fi.Designer.cs</LastGenOutput>
|
||||
</EmbeddedResource>
|
||||
<EmbeddedResource Include="Resources\AppResources.fr.resx">
|
||||
<Generator>ResXFileCodeGenerator</Generator>
|
||||
<LastGenOutput>AppResources.fr.Designer.cs</LastGenOutput>
|
||||
</EmbeddedResource>
|
||||
<EmbeddedResource Include="Resources\AppResources.sv.resx">
|
||||
<Generator>ResXFileCodeGenerator</Generator>
|
||||
<LastGenOutput>AppResources.sv.Designer.cs</LastGenOutput>
|
||||
</EmbeddedResource>
|
||||
<EmbeddedResource Include="Resources\AppResources.zh-Hans.resx">
|
||||
<Generator>ResXFileCodeGenerator</Generator>
|
||||
<LastGenOutput>AppResources.zh-Hans.Designer.cs</LastGenOutput>
|
||||
</EmbeddedResource>
|
||||
<EmbeddedResource Include="Resources\public_suffix_list.dat" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<Reference Include="Acr.UserDialogs, Version=1.0.0.0, Culture=neutral, processorArchitecture=MSIL">
|
||||
<HintPath>..\..\packages\Acr.UserDialogs.6.0.1\lib\portable-win+net45+wp8+win8+wpa81\Acr.UserDialogs.dll</HintPath>
|
||||
<HintPath>..\..\packages\Acr.UserDialogs.6.3.3\lib\portable-win+net45+wp8+win8+wpa81\Acr.UserDialogs.dll</HintPath>
|
||||
<Private>True</Private>
|
||||
</Reference>
|
||||
<Reference Include="Acr.UserDialogs.Interface, Version=1.0.0.0, Culture=neutral, processorArchitecture=MSIL">
|
||||
<HintPath>..\..\packages\Acr.UserDialogs.6.0.1\lib\portable-win+net45+wp8+win8+wpa81\Acr.UserDialogs.Interface.dll</HintPath>
|
||||
<HintPath>..\..\packages\Acr.UserDialogs.6.3.3\lib\portable-win+net45+wp8+win8+wpa81\Acr.UserDialogs.Interface.dll</HintPath>
|
||||
<Private>True</Private>
|
||||
</Reference>
|
||||
<Reference Include="HockeySDK, Version=1.0.6018.21545, Culture=neutral, processorArchitecture=MSIL">
|
||||
<HintPath>..\..\packages\HockeySDK.Xamarin.4.1.0-beta3\lib\portable-net45+wp8+wpa81+win8+MonoAndroid10+MonoTouch10+Xamarin.iOS10\HockeySDK.dll</HintPath>
|
||||
<Reference Include="HockeySDK, Version=1.0.6103.22141, Culture=neutral, processorArchitecture=MSIL">
|
||||
<HintPath>..\..\packages\HockeySDK.Xamarin.4.1.0\lib\portable-net45+wp8+wpa81+win8+MonoAndroid10+MonoTouch10+Xamarin.iOS10\HockeySDK.dll</HintPath>
|
||||
<Private>True</Private>
|
||||
</Reference>
|
||||
<Reference Include="Microsoft.Practices.ServiceLocation, Version=1.3.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35, processorArchitecture=MSIL">
|
||||
@@ -212,9 +270,8 @@
|
||||
<HintPath>..\..\packages\Unity.3.5.1405-prerelease\lib\portable-net45+wp80+win8+wpa81+MonoAndroid10+MonoTouch10\Microsoft.Practices.Unity.dll</HintPath>
|
||||
<Private>True</Private>
|
||||
</Reference>
|
||||
<Reference Include="ModernHttpClient, Version=2.4.2.0, Culture=neutral, processorArchitecture=MSIL">
|
||||
<HintPath>..\..\packages\modernhttpclient.2.4.2\lib\Portable-Net45+WinRT45+WP8+WPA81\ModernHttpClient.dll</HintPath>
|
||||
<Private>True</Private>
|
||||
<Reference Include="Mono.Android">
|
||||
<HintPath>..\..\..\..\Program Files (x86)\Reference Assemblies\Microsoft\Framework\MonoAndroid\v6.0\Mono.Android.dll</HintPath>
|
||||
</Reference>
|
||||
<Reference Include="Newtonsoft.Json, Version=9.0.0.0, Culture=neutral, PublicKeyToken=30ad4fe6b2a6aeed, processorArchitecture=MSIL">
|
||||
<HintPath>..\..\packages\Newtonsoft.Json.9.0.1\lib\portable-net45+wp80+win8+wpa81\Newtonsoft.Json.dll</HintPath>
|
||||
@@ -225,19 +282,19 @@
|
||||
<Private>True</Private>
|
||||
</Reference>
|
||||
<Reference Include="PInvoke.BCrypt, Version=0.3.0.0, Culture=neutral, PublicKeyToken=9e300f9f87f04a7a, processorArchitecture=MSIL">
|
||||
<HintPath>..\..\packages\PInvoke.BCrypt.0.3.2\lib\portable-net45+win+wpa81+MonoAndroid10+xamarinios10+MonoTouch10\PInvoke.BCrypt.dll</HintPath>
|
||||
<HintPath>..\..\packages\PInvoke.BCrypt.0.3.152\lib\portable-net45+win+wpa81+MonoAndroid10+xamarinios10+MonoTouch10\PInvoke.BCrypt.dll</HintPath>
|
||||
<Private>True</Private>
|
||||
</Reference>
|
||||
<Reference Include="PInvoke.Kernel32, Version=0.3.0.0, Culture=neutral, PublicKeyToken=9e300f9f87f04a7a, processorArchitecture=MSIL">
|
||||
<HintPath>..\..\packages\PInvoke.Kernel32.0.3.2\lib\portable-net45+win+wpa81+MonoAndroid10+xamarinios10+MonoTouch10\PInvoke.Kernel32.dll</HintPath>
|
||||
<HintPath>..\..\packages\PInvoke.Kernel32.0.3.152\lib\portable-net45+win+wpa81+MonoAndroid10+xamarinios10+MonoTouch10\PInvoke.Kernel32.dll</HintPath>
|
||||
<Private>True</Private>
|
||||
</Reference>
|
||||
<Reference Include="PInvoke.NCrypt, Version=0.3.0.0, Culture=neutral, PublicKeyToken=9e300f9f87f04a7a, processorArchitecture=MSIL">
|
||||
<HintPath>..\..\packages\PInvoke.NCrypt.0.3.2\lib\portable-net45+win+wpa81+MonoAndroid10+xamarinios10+MonoTouch10\PInvoke.NCrypt.dll</HintPath>
|
||||
<HintPath>..\..\packages\PInvoke.NCrypt.0.3.152\lib\portable-net45+win+wpa81+MonoAndroid10+xamarinios10+MonoTouch10\PInvoke.NCrypt.dll</HintPath>
|
||||
<Private>True</Private>
|
||||
</Reference>
|
||||
<Reference Include="PInvoke.Windows.Core, Version=0.3.0.0, Culture=neutral, PublicKeyToken=9e300f9f87f04a7a, processorArchitecture=MSIL">
|
||||
<HintPath>..\..\packages\PInvoke.Windows.Core.0.3.2\lib\portable-net45+win+wpa81+MonoAndroid10+xamarinios10+MonoTouch10\PInvoke.Windows.Core.dll</HintPath>
|
||||
<HintPath>..\..\packages\PInvoke.Windows.Core.0.3.152\lib\portable-net45+win+wpa81+MonoAndroid10+xamarinios10+MonoTouch10\PInvoke.Windows.Core.dll</HintPath>
|
||||
<Private>True</Private>
|
||||
</Reference>
|
||||
<Reference Include="Plugin.Connectivity, Version=2.2.12.0, Culture=neutral, processorArchitecture=MSIL">
|
||||
@@ -256,20 +313,20 @@
|
||||
<HintPath>..\..\packages\Plugin.Fingerprint.1.2.0\lib\portable-net45+win8+wpa81+wp8\Plugin.Fingerprint.Abstractions.dll</HintPath>
|
||||
<Private>True</Private>
|
||||
</Reference>
|
||||
<Reference Include="Plugin.Settings, Version=2.1.0.0, Culture=neutral, processorArchitecture=MSIL">
|
||||
<HintPath>..\..\packages\Xam.Plugins.Settings.2.1.0\lib\portable-net45+wp8+wpa81+win8+MonoAndroid10+MonoTouch10+Xamarin.iOS10+UAP10\Plugin.Settings.dll</HintPath>
|
||||
<Reference Include="Plugin.Settings, Version=2.5.1.0, Culture=neutral, processorArchitecture=MSIL">
|
||||
<HintPath>..\..\packages\Xam.Plugins.Settings.2.5.1.0\lib\portable-net45+wp80+win8+wpa81\Plugin.Settings.dll</HintPath>
|
||||
<Private>True</Private>
|
||||
</Reference>
|
||||
<Reference Include="Plugin.Settings.Abstractions, Version=2.1.0.0, Culture=neutral, processorArchitecture=MSIL">
|
||||
<HintPath>..\..\packages\Xam.Plugins.Settings.2.1.0\lib\portable-net45+wp8+wpa81+win8+MonoAndroid10+MonoTouch10+Xamarin.iOS10+UAP10\Plugin.Settings.Abstractions.dll</HintPath>
|
||||
<Reference Include="Plugin.Settings.Abstractions, Version=2.5.1.0, Culture=neutral, processorArchitecture=MSIL">
|
||||
<HintPath>..\..\packages\Xam.Plugins.Settings.2.5.1.0\lib\portable-net45+wp80+win8+wpa81\Plugin.Settings.Abstractions.dll</HintPath>
|
||||
<Private>True</Private>
|
||||
</Reference>
|
||||
<Reference Include="PushNotification.Plugin, Version=1.0.0.0, Culture=neutral, processorArchitecture=MSIL">
|
||||
<HintPath>..\..\packages\Xam.Plugin.PushNotification.1.2.2\lib\portable-net45+wp8+wpa81+win8+MonoAndroid10+MonoTouch10+Xamarin.iOS10+UAP10\PushNotification.Plugin.dll</HintPath>
|
||||
<HintPath>..\..\packages\Xam.Plugin.PushNotification.1.2.4\lib\portable-net45+wp8+wpa81+win8+MonoAndroid10+MonoTouch10+Xamarin.iOS10+UAP10\PushNotification.Plugin.dll</HintPath>
|
||||
<Private>True</Private>
|
||||
</Reference>
|
||||
<Reference Include="PushNotification.Plugin.Abstractions, Version=1.0.0.0, Culture=neutral, processorArchitecture=MSIL">
|
||||
<HintPath>..\..\packages\Xam.Plugin.PushNotification.1.2.2\lib\portable-net45+wp8+wpa81+win8+MonoAndroid10+MonoTouch10+Xamarin.iOS10+UAP10\PushNotification.Plugin.Abstractions.dll</HintPath>
|
||||
<HintPath>..\..\packages\Xam.Plugin.PushNotification.1.2.4\lib\portable-net45+wp8+wpa81+win8+MonoAndroid10+MonoTouch10+Xamarin.iOS10+UAP10\PushNotification.Plugin.Abstractions.dll</HintPath>
|
||||
<Private>True</Private>
|
||||
</Reference>
|
||||
<Reference Include="Splat, Version=1.6.2.0, Culture=neutral, processorArchitecture=MSIL">
|
||||
@@ -277,7 +334,7 @@
|
||||
<Private>True</Private>
|
||||
</Reference>
|
||||
<Reference Include="SQLite-net, Version=1.1.0.0, Culture=neutral, processorArchitecture=MSIL">
|
||||
<HintPath>..\..\packages\sqlite-net-pcl.1.1.2\lib\portable-net45+wp8+wpa81+win8+MonoAndroid10+MonoTouch10+Xamarin.iOS10\SQLite-net.dll</HintPath>
|
||||
<HintPath>..\..\packages\sqlite-net-pcl.1.2.1\lib\portable-net45+wp8+wpa81+win8+MonoAndroid10+MonoTouch10+Xamarin.iOS10\SQLite-net.dll</HintPath>
|
||||
<Private>True</Private>
|
||||
</Reference>
|
||||
<Reference Include="SQLitePCL.batteries, Version=0.0.0.0, Culture=neutral, processorArchitecture=MSIL">
|
||||
@@ -288,20 +345,32 @@
|
||||
<HintPath>..\..\packages\SQLitePCL.raw.0.9.3\lib\portable-net45+netcore45+wpa81+MonoAndroid10+MonoTouch10+Xamarin.iOS10\SQLitePCL.raw.dll</HintPath>
|
||||
<Private>True</Private>
|
||||
</Reference>
|
||||
<Reference Include="Validation, Version=2.2.0.0, Culture=neutral, PublicKeyToken=2fc06f0d701809a7, processorArchitecture=MSIL">
|
||||
<HintPath>..\..\packages\Validation.2.2.8\lib\portable-net40+sl50+win+wpa81+wp80+MonoAndroid10+xamarinios10+MonoTouch10\Validation.dll</HintPath>
|
||||
<Reference Include="SQLitePCLRaw.batteries_green, Version=1.0.0.0, Culture=neutral, PublicKeyToken=a84b7dcfb1391f7f, processorArchitecture=MSIL">
|
||||
<HintPath>..\..\packages\SQLitePCLRaw.bundle_green.1.1.2\lib\portable-net45+netcore45+wpa81+MonoAndroid10+MonoTouch10+Xamarin.iOS10\SQLitePCLRaw.batteries_green.dll</HintPath>
|
||||
<Private>True</Private>
|
||||
</Reference>
|
||||
<Reference Include="SQLitePCLRaw.batteries_v2, Version=1.0.0.0, Culture=neutral, PublicKeyToken=8226ea5df37bcae9, processorArchitecture=MSIL">
|
||||
<HintPath>..\..\packages\SQLitePCLRaw.bundle_green.1.1.2\lib\portable-net45+netcore45+wpa81+MonoAndroid10+MonoTouch10+Xamarin.iOS10\SQLitePCLRaw.batteries_v2.dll</HintPath>
|
||||
<Private>True</Private>
|
||||
</Reference>
|
||||
<Reference Include="SQLitePCLRaw.core, Version=1.0.0.0, Culture=neutral, PublicKeyToken=1488e028ca7ab535, processorArchitecture=MSIL">
|
||||
<HintPath>..\..\packages\SQLitePCLRaw.core.1.1.2\lib\portable-net45+netcore45+wpa81+MonoAndroid10+MonoTouch10+Xamarin.iOS10\SQLitePCLRaw.core.dll</HintPath>
|
||||
<Private>True</Private>
|
||||
</Reference>
|
||||
<Reference Include="Validation, Version=2.3.0.0, Culture=neutral, PublicKeyToken=2fc06f0d701809a7, processorArchitecture=MSIL">
|
||||
<HintPath>..\..\packages\Validation.2.3.7\lib\portable-net45+win+wpa81+wp80+MonoAndroid10+xamarinios10+MonoTouch10\Validation.dll</HintPath>
|
||||
<Private>True</Private>
|
||||
</Reference>
|
||||
<Reference Include="Xamarin.Forms.Core, Version=2.0.0.0, Culture=neutral, processorArchitecture=MSIL">
|
||||
<HintPath>..\..\packages\Xamarin.Forms.2.3.2.127\lib\portable-win+net45+wp80+win81+wpa81+MonoAndroid10+MonoTouch10+Xamarin.iOS10\Xamarin.Forms.Core.dll</HintPath>
|
||||
<HintPath>..\..\packages\Xamarin.Forms.2.3.3.180\lib\portable-win+net45+wp80+win81+wpa81+MonoAndroid10+Xamarin.iOS10+xamarinmac20\Xamarin.Forms.Core.dll</HintPath>
|
||||
<Private>True</Private>
|
||||
</Reference>
|
||||
<Reference Include="Xamarin.Forms.Platform, Version=1.0.0.0, Culture=neutral, processorArchitecture=MSIL">
|
||||
<HintPath>..\..\packages\Xamarin.Forms.2.3.2.127\lib\portable-win+net45+wp80+win81+wpa81+MonoAndroid10+MonoTouch10+Xamarin.iOS10\Xamarin.Forms.Platform.dll</HintPath>
|
||||
<HintPath>..\..\packages\Xamarin.Forms.2.3.3.180\lib\portable-win+net45+wp80+win81+wpa81+MonoAndroid10+Xamarin.iOS10+xamarinmac20\Xamarin.Forms.Platform.dll</HintPath>
|
||||
<Private>True</Private>
|
||||
</Reference>
|
||||
<Reference Include="Xamarin.Forms.Xaml, Version=2.0.0.0, Culture=neutral, processorArchitecture=MSIL">
|
||||
<HintPath>..\..\packages\Xamarin.Forms.2.3.2.127\lib\portable-win+net45+wp80+win81+wpa81+MonoAndroid10+MonoTouch10+Xamarin.iOS10\Xamarin.Forms.Xaml.dll</HintPath>
|
||||
<HintPath>..\..\packages\Xamarin.Forms.2.3.3.180\lib\portable-win+net45+wp80+win81+wpa81+MonoAndroid10+Xamarin.iOS10+xamarinmac20\Xamarin.Forms.Xaml.dll</HintPath>
|
||||
<Private>True</Private>
|
||||
</Reference>
|
||||
<Reference Include="XLabs.Ioc, Version=2.0.5782.12218, Culture=neutral, processorArchitecture=MSIL">
|
||||
@@ -319,12 +388,12 @@
|
||||
<Compile Include="Services\PushNotificationListener.cs" />
|
||||
</ItemGroup>
|
||||
<Import Project="$(MSBuildExtensionsPath32)\Microsoft\Portable\$(TargetFrameworkVersion)\Microsoft.Portable.CSharp.targets" />
|
||||
<Import Project="..\..\packages\Xamarin.Forms.2.3.2.127\build\portable-win+net45+wp80+win81+wpa81+MonoAndroid10+MonoTouch10+Xamarin.iOS10\Xamarin.Forms.targets" Condition="Exists('..\..\packages\Xamarin.Forms.2.3.2.127\build\portable-win+net45+wp80+win81+wpa81+MonoAndroid10+MonoTouch10+Xamarin.iOS10\Xamarin.Forms.targets')" />
|
||||
<Import Project="..\..\packages\Xamarin.Forms.2.3.3.180\build\portable-win+net45+wp80+win81+wpa81+MonoAndroid10+Xamarin.iOS10+xamarinmac20\Xamarin.Forms.targets" Condition="Exists('..\..\packages\Xamarin.Forms.2.3.3.180\build\portable-win+net45+wp80+win81+wpa81+MonoAndroid10+Xamarin.iOS10+xamarinmac20\Xamarin.Forms.targets')" />
|
||||
<Target Name="EnsureNuGetPackageBuildImports" BeforeTargets="PrepareForBuild">
|
||||
<PropertyGroup>
|
||||
<ErrorText>This project references NuGet package(s) that are missing on this computer. Use NuGet Package Restore to download them. For more information, see http://go.microsoft.com/fwlink/?LinkID=322105. The missing file is {0}.</ErrorText>
|
||||
</PropertyGroup>
|
||||
<Error Condition="!Exists('..\..\packages\Xamarin.Forms.2.3.2.127\build\portable-win+net45+wp80+win81+wpa81+MonoAndroid10+MonoTouch10+Xamarin.iOS10\Xamarin.Forms.targets')" Text="$([System.String]::Format('$(ErrorText)', '..\..\packages\Xamarin.Forms.2.3.2.127\build\portable-win+net45+wp80+win81+wpa81+MonoAndroid10+MonoTouch10+Xamarin.iOS10\Xamarin.Forms.targets'))" />
|
||||
<Error Condition="!Exists('..\..\packages\Xamarin.Forms.2.3.3.180\build\portable-win+net45+wp80+win81+wpa81+MonoAndroid10+Xamarin.iOS10+xamarinmac20\Xamarin.Forms.targets')" Text="$([System.String]::Format('$(ErrorText)', '..\..\packages\Xamarin.Forms.2.3.3.180\build\portable-win+net45+wp80+win81+wpa81+MonoAndroid10+Xamarin.iOS10+xamarinmac20\Xamarin.Forms.targets'))" />
|
||||
</Target>
|
||||
<!-- To modify your build process, add your task inside one of the targets below and uncomment it.
|
||||
Other similar extension points exist, see Microsoft.Common.targets.
|
||||
|
||||
@@ -1,43 +0,0 @@
|
||||
using System;
|
||||
using Plugin.Connectivity.Abstractions;
|
||||
using Xamarin.Forms;
|
||||
using XLabs.Ioc;
|
||||
|
||||
namespace Bit.App.Behaviors
|
||||
{
|
||||
public class ConnectivityBehavior : Behavior<Element>
|
||||
{
|
||||
private readonly IConnectivity _connectivity;
|
||||
|
||||
public ConnectivityBehavior()
|
||||
{
|
||||
_connectivity = Resolver.Resolve<IConnectivity>();
|
||||
}
|
||||
|
||||
private static readonly BindablePropertyKey IsValidPropertyKey = BindableProperty.CreateReadOnly("Connected", typeof(bool), typeof(ConnectivityBehavior), false);
|
||||
public static readonly BindableProperty IsValidProperty = IsValidPropertyKey.BindableProperty;
|
||||
|
||||
public bool Connected
|
||||
{
|
||||
get { return (bool)GetValue(IsValidProperty); }
|
||||
private set { SetValue(IsValidPropertyKey, value); }
|
||||
}
|
||||
|
||||
protected override void OnAttachedTo(Element el)
|
||||
{
|
||||
_connectivity.ConnectivityChanged += ConnectivityChanged;
|
||||
base.OnAttachedTo(el);
|
||||
}
|
||||
|
||||
private void ConnectivityChanged(object sender, ConnectivityChangedEventArgs e)
|
||||
{
|
||||
Connected = e.IsConnected;
|
||||
}
|
||||
|
||||
protected override void OnDetachingFrom(Element el)
|
||||
{
|
||||
_connectivity.ConnectivityChanged -= ConnectivityChanged;
|
||||
base.OnDetachingFrom(el);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1,39 +0,0 @@
|
||||
using System;
|
||||
using System.Text.RegularExpressions;
|
||||
using Xamarin.Forms;
|
||||
|
||||
namespace Bit.App.Behaviors
|
||||
{
|
||||
public class EmailValidationBehavior : Behavior<Entry>
|
||||
{
|
||||
private const string EmailRegex = @"^(?("")("".+?(?<!\\)""@)|(([0-9a-z]((\.(?!\.))|[-!#\$%&'\*\+/=\?\^`\{\}\|~\w])*)(?<=[0-9a-z])@))" +
|
||||
@"(?(\[)(\[(\d{1,3}\.){3}\d{1,3}\])|(([0-9a-z][-\w]*[0-9a-z]*\.)+[a-z0-9][\-a-z0-9]{0,22}[a-z0-9]))$";
|
||||
|
||||
private static readonly BindablePropertyKey IsValidPropertyKey = BindableProperty.CreateReadOnly("IsValid", typeof(bool), typeof(EmailValidationBehavior), false);
|
||||
public static readonly BindableProperty IsValidProperty = IsValidPropertyKey.BindableProperty;
|
||||
|
||||
public bool IsValid
|
||||
{
|
||||
get { return (bool)GetValue(IsValidProperty); }
|
||||
private set { SetValue(IsValidPropertyKey, value); }
|
||||
}
|
||||
|
||||
protected override void OnAttachedTo(Entry entry)
|
||||
{
|
||||
entry.TextChanged += HandleTextChanged;
|
||||
base.OnAttachedTo(entry);
|
||||
}
|
||||
|
||||
void HandleTextChanged(object sender, TextChangedEventArgs e)
|
||||
{
|
||||
IsValid = Regex.IsMatch(e.NewTextValue, EmailRegex, RegexOptions.IgnoreCase, TimeSpan.FromMilliseconds(250));
|
||||
((Entry)sender).BackgroundColor = IsValid ? Color.Default : Color.Red;
|
||||
}
|
||||
|
||||
protected override void OnDetachingFrom(Entry entry)
|
||||
{
|
||||
entry.TextChanged -= HandleTextChanged;
|
||||
base.OnDetachingFrom(entry);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1,35 +0,0 @@
|
||||
using System;
|
||||
using Xamarin.Forms;
|
||||
|
||||
namespace Bit.App.Behaviors
|
||||
{
|
||||
public class RequiredValidationBehavior : Behavior<Entry>
|
||||
{
|
||||
private static readonly BindablePropertyKey IsValidPropertyKey = BindableProperty.CreateReadOnly("IsValid", typeof(bool), typeof(RequiredValidationBehavior), false);
|
||||
public static readonly BindableProperty IsValidProperty = IsValidPropertyKey.BindableProperty;
|
||||
|
||||
public bool IsValid
|
||||
{
|
||||
get { return (bool)GetValue(IsValidProperty); }
|
||||
private set { SetValue(IsValidPropertyKey, value); }
|
||||
}
|
||||
|
||||
protected override void OnAttachedTo(Entry entry)
|
||||
{
|
||||
entry.TextChanged += HandleTextChanged;
|
||||
base.OnAttachedTo(entry);
|
||||
}
|
||||
|
||||
void HandleTextChanged(object sender, TextChangedEventArgs e)
|
||||
{
|
||||
IsValid = !string.IsNullOrWhiteSpace(e.NewTextValue);
|
||||
((Entry)sender).BackgroundColor = IsValid ? Color.Default : Color.Red;
|
||||
}
|
||||
|
||||
protected override void OnDetachingFrom(Entry entry)
|
||||
{
|
||||
entry.TextChanged -= HandleTextChanged;
|
||||
base.OnDetachingFrom(entry);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -2,6 +2,8 @@
|
||||
{
|
||||
public static class Constants
|
||||
{
|
||||
public const string AndroidAppProtocol = "androidapp://";
|
||||
|
||||
public const string SettingFingerprintUnlockOn = "setting:fingerprintUnlockOn";
|
||||
public const string SettingPinUnlockOn = "setting:pinUnlockOn";
|
||||
public const string SettingLockSeconds = "setting:lockSeconds";
|
||||
|
||||
@@ -1,4 +1,5 @@
|
||||
using System;
|
||||
using Bit.App.Resources;
|
||||
using System;
|
||||
using Xamarin.Forms;
|
||||
|
||||
namespace Bit.App.Controls
|
||||
@@ -12,7 +13,7 @@ namespace Bit.App.Controls
|
||||
{
|
||||
_cancelClickedAction = cancelClickedAction;
|
||||
_page = page;
|
||||
Text = text ?? "Close";
|
||||
Text = text ?? AppResources.Close;
|
||||
Clicked += ClickedItem;
|
||||
Priority = -1;
|
||||
}
|
||||
|
||||
@@ -12,6 +12,8 @@ namespace Bit.App.Controls
|
||||
{
|
||||
PlaceholderColor = Color.FromHex("c7c7cd");
|
||||
}
|
||||
|
||||
IsPasswordFromToggled = IsPassword;
|
||||
}
|
||||
|
||||
public static readonly BindableProperty HasBorderProperty =
|
||||
@@ -62,5 +64,21 @@ namespace Bit.App.Controls
|
||||
{
|
||||
Completed?.Invoke(this, null);
|
||||
}
|
||||
|
||||
public virtual void InvokeToggleIsPassword()
|
||||
{
|
||||
if(ToggleIsPassword == null)
|
||||
{
|
||||
IsPassword = IsPasswordFromToggled = !IsPassword;
|
||||
Focus();
|
||||
}
|
||||
else
|
||||
{
|
||||
ToggleIsPassword.Invoke(this, null);
|
||||
}
|
||||
}
|
||||
|
||||
public event EventHandler ToggleIsPassword;
|
||||
public bool IsPasswordFromToggled { get; set; } = false;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -10,11 +10,12 @@ namespace Bit.App.Controls
|
||||
public FormEntryCell(
|
||||
string labelText,
|
||||
Keyboard entryKeyboard = null,
|
||||
bool IsPassword = false,
|
||||
bool isPassword = false,
|
||||
VisualElement nextElement = null,
|
||||
bool useLabelAsPlaceholder = false,
|
||||
string imageSource = null,
|
||||
Thickness? containerPadding = null)
|
||||
Thickness? containerPadding = null,
|
||||
bool useButton = false)
|
||||
{
|
||||
if(!useLabelAsPlaceholder)
|
||||
{
|
||||
@@ -31,9 +32,10 @@ namespace Bit.App.Controls
|
||||
{
|
||||
Keyboard = entryKeyboard,
|
||||
HasBorder = false,
|
||||
IsPassword = IsPassword,
|
||||
IsPassword = isPassword,
|
||||
AllowClear = true,
|
||||
HorizontalOptions = LayoutOptions.FillAndExpand,
|
||||
WidthRequest = 1,
|
||||
FontSize = Device.GetNamedSize(NamedSize.Medium, typeof(Entry))
|
||||
};
|
||||
|
||||
@@ -112,6 +114,18 @@ namespace Bit.App.Controls
|
||||
formStackLayout.Children.Add(Entry);
|
||||
imageStackLayout.Children.Add(formStackLayout);
|
||||
|
||||
if(useButton)
|
||||
{
|
||||
Button = new ExtendedButton();
|
||||
imageStackLayout.Children.Add(Button);
|
||||
|
||||
if(Device.OS == TargetPlatform.Android)
|
||||
{
|
||||
Button.Padding = new Thickness(0);
|
||||
Button.BackgroundColor = Color.Transparent;
|
||||
}
|
||||
}
|
||||
|
||||
Tapped += FormEntryCell_Tapped;
|
||||
|
||||
View = imageStackLayout;
|
||||
@@ -119,6 +133,7 @@ namespace Bit.App.Controls
|
||||
|
||||
public Label Label { get; private set; }
|
||||
public ExtendedEntry Entry { get; private set; }
|
||||
public ExtendedButton Button { get; private set; }
|
||||
|
||||
private void Tgr_Tapped(object sender, EventArgs e)
|
||||
{
|
||||
|
||||
@@ -19,37 +19,32 @@ namespace Bit.App.Controls
|
||||
Style = (Style)Application.Current.Resources["text-muted"]
|
||||
};
|
||||
|
||||
var labelDetailStackLayout = new StackLayout
|
||||
{
|
||||
HorizontalOptions = LayoutOptions.StartAndExpand,
|
||||
VerticalOptions = LayoutOptions.CenterAndExpand,
|
||||
Children = { Label, Detail },
|
||||
Padding = Device.OnPlatform(
|
||||
iOS: new Thickness(15, 5, 5, 5),
|
||||
Android: new Thickness(15, 0, 5, 5),
|
||||
WinPhone: new Thickness(15, 5, 5, 5)),
|
||||
Spacing = 0
|
||||
};
|
||||
|
||||
Button = new ExtendedButton
|
||||
{
|
||||
HorizontalOptions = LayoutOptions.End,
|
||||
VerticalOptions = LayoutOptions.CenterAndExpand,
|
||||
WidthRequest = 50
|
||||
WidthRequest = 60
|
||||
};
|
||||
|
||||
var containerStackLayout = new StackLayout
|
||||
var grid = new Grid
|
||||
{
|
||||
Orientation = StackOrientation.Horizontal,
|
||||
Children = { labelDetailStackLayout, Button }
|
||||
ColumnSpacing = 0,
|
||||
RowSpacing = 0,
|
||||
Padding = new Thickness(15, 3, 0, 3)
|
||||
};
|
||||
grid.RowDefinitions.Add(new RowDefinition { Height = new GridLength(1, GridUnitType.Star) });
|
||||
grid.RowDefinitions.Add(new RowDefinition { Height = new GridLength(1, GridUnitType.Star) });
|
||||
grid.ColumnDefinitions.Add(new ColumnDefinition { Width = new GridLength(1, GridUnitType.Star) });
|
||||
grid.ColumnDefinitions.Add(new ColumnDefinition { Width = new GridLength(60, GridUnitType.Absolute) });
|
||||
grid.Children.Add(Label, 0, 0);
|
||||
grid.Children.Add(Detail, 0, 1);
|
||||
grid.Children.Add(Button, 1, 0);
|
||||
Grid.SetRowSpan(Button, 2);
|
||||
|
||||
if(Device.OS == TargetPlatform.Android)
|
||||
{
|
||||
Label.TextColor = Color.Black;
|
||||
}
|
||||
|
||||
View = containerStackLayout;
|
||||
View = grid;
|
||||
}
|
||||
|
||||
public Label Label { get; private set; }
|
||||
|
||||
@@ -84,17 +84,19 @@ namespace Bit.App.Controls
|
||||
|
||||
if(Device.OS == TargetPlatform.Android)
|
||||
{
|
||||
//if(Button1 != null)
|
||||
//{
|
||||
// Button1.Padding = new Thickness(5);
|
||||
// Button1.BackgroundColor = Color.Transparent;
|
||||
//}
|
||||
//if(Button2 != null)
|
||||
//{
|
||||
// Button2.Padding = new Thickness(5);
|
||||
// Button2.BackgroundColor = Color.Transparent;
|
||||
//}
|
||||
|
||||
buttonStackLayout.Spacing = 5;
|
||||
|
||||
if(Button1 != null)
|
||||
{
|
||||
Button1.Padding = new Thickness(0);
|
||||
Button1.BackgroundColor = Color.Transparent;
|
||||
}
|
||||
if(Button2 != null)
|
||||
{
|
||||
Button2.Padding = new Thickness(0);
|
||||
Button2.BackgroundColor = Color.Transparent;
|
||||
}
|
||||
|
||||
containerStackLayout.AdjustPaddingForDevice();
|
||||
}
|
||||
|
||||
|
||||
40
src/App/Controls/VaultListViewCell.cs
Normal file
@@ -0,0 +1,40 @@
|
||||
using Bit.App.Models.Page;
|
||||
using System;
|
||||
using Xamarin.Forms;
|
||||
|
||||
namespace Bit.App.Controls
|
||||
{
|
||||
public class VaultListViewCell : LabeledDetailCell
|
||||
{
|
||||
private Action<VaultListPageModel.Login> _moreClickedAction;
|
||||
|
||||
public static readonly BindableProperty LoginParameterProperty = BindableProperty.Create(nameof(LoginParameter),
|
||||
typeof(VaultListPageModel.Login), typeof(VaultListViewCell), null);
|
||||
|
||||
public VaultListViewCell(Action<VaultListPageModel.Login> moreClickedAction)
|
||||
{
|
||||
_moreClickedAction = moreClickedAction;
|
||||
|
||||
SetBinding(LoginParameterProperty, new Binding("."));
|
||||
Label.SetBinding<VaultListPageModel.Login>(Label.TextProperty, s => s.Name);
|
||||
Detail.SetBinding<VaultListPageModel.Login>(Label.TextProperty, s => s.Username);
|
||||
|
||||
Button.Image = "more";
|
||||
Button.Command = new Command(() => ShowMore());
|
||||
Button.BackgroundColor = Color.Transparent;
|
||||
|
||||
BackgroundColor = Color.White;
|
||||
}
|
||||
|
||||
public VaultListPageModel.Login LoginParameter
|
||||
{
|
||||
get { return GetValue(LoginParameterProperty) as VaultListPageModel.Login; }
|
||||
set { SetValue(LoginParameterProperty, value); }
|
||||
}
|
||||
|
||||
private void ShowMore()
|
||||
{
|
||||
_moreClickedAction?.Invoke(LoginParameter);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -3,6 +3,6 @@
|
||||
public enum CipherType : short
|
||||
{
|
||||
Folder = 0,
|
||||
Site = 1
|
||||
Login = 1
|
||||
}
|
||||
}
|
||||
|
||||
@@ -4,7 +4,7 @@
|
||||
{
|
||||
SyncCipherUpdate = 0,
|
||||
SyncCipherCreate = 1,
|
||||
SyncSiteDelete = 2,
|
||||
SyncLoginDelete = 2,
|
||||
SyncFolderDelete = 3,
|
||||
SyncCiphers = 4
|
||||
}
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
namespace Bit.App.Models.Api
|
||||
{
|
||||
public class SiteDataModel
|
||||
public class LoginDataModel
|
||||
{
|
||||
public string Name { get; set; }
|
||||
public string Uri { get; set; }
|
||||
24
src/App/Models/Api/Request/LoginRequest.cs
Normal file
@@ -0,0 +1,24 @@
|
||||
namespace Bit.App.Models.Api
|
||||
{
|
||||
public class LoginRequest
|
||||
{
|
||||
public LoginRequest(Login login)
|
||||
{
|
||||
FolderId = login.FolderId;
|
||||
Name = login.Name?.EncryptedString;
|
||||
Uri = login.Uri?.EncryptedString;
|
||||
Username = login.Username?.EncryptedString;
|
||||
Password = login.Password?.EncryptedString;
|
||||
Notes = login.Notes?.EncryptedString;
|
||||
Favorite = login.Favorite;
|
||||
}
|
||||
|
||||
public string FolderId { get; set; }
|
||||
public string Name { get; set; }
|
||||
public string Uri { get; set; }
|
||||
public string Username { get; set; }
|
||||
public string Password { get; set; }
|
||||
public string Notes { get; set; }
|
||||
public bool Favorite { get; set; }
|
||||
}
|
||||
}
|
||||
@@ -1,24 +0,0 @@
|
||||
namespace Bit.App.Models.Api
|
||||
{
|
||||
public class SiteRequest
|
||||
{
|
||||
public SiteRequest(Site site)
|
||||
{
|
||||
FolderId = site.FolderId;
|
||||
Name = site.Name?.EncryptedString;
|
||||
Uri = site.Uri?.EncryptedString;
|
||||
Username = site.Username?.EncryptedString;
|
||||
Password = site.Password?.EncryptedString;
|
||||
Notes = site.Notes?.EncryptedString;
|
||||
Favorite = site.Favorite;
|
||||
}
|
||||
|
||||
public string FolderId { get; set; }
|
||||
public string Name { get; set; }
|
||||
public string Uri { get; set; }
|
||||
public string Username { get; set; }
|
||||
public string Password { get; set; }
|
||||
public string Notes { get; set; }
|
||||
public bool Favorite { get; set; }
|
||||
}
|
||||
}
|
||||
@@ -1,9 +1,49 @@
|
||||
namespace Bit.App.Models.Api
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
|
||||
namespace Bit.App.Models.Api
|
||||
{
|
||||
public class TokenRequest
|
||||
{
|
||||
public string Email { get; set; }
|
||||
public string MasterPasswordHash { get; set; }
|
||||
public string Token { get; set; }
|
||||
public int? Provider { get; set; }
|
||||
[Obsolete]
|
||||
public string OldAuthBearer { get; set; }
|
||||
public DeviceRequest Device { get; set; }
|
||||
|
||||
public IDictionary<string, string> ToIdentityTokenRequest()
|
||||
{
|
||||
var dict = new Dictionary<string, string>
|
||||
{
|
||||
{ "grant_type", "password" },
|
||||
{ "username", Email },
|
||||
{ "password", MasterPasswordHash },
|
||||
{ "scope", "api offline_access" },
|
||||
{ "client_id", "mobile" }
|
||||
};
|
||||
|
||||
if(OldAuthBearer != null)
|
||||
{
|
||||
dict.Add("OldAuthBearer", OldAuthBearer);
|
||||
}
|
||||
|
||||
if(Device != null)
|
||||
{
|
||||
dict.Add("DeviceType", Device.Type.ToString());
|
||||
dict.Add("DeviceIdentifier", Device.Identifier);
|
||||
dict.Add("DeviceName", Device.Name);
|
||||
dict.Add("DevicePushToken", Device.PushToken);
|
||||
}
|
||||
|
||||
if(Token != null && Provider.HasValue)
|
||||
{
|
||||
dict.Add("TwoFactorToken", Token);
|
||||
dict.Add("TwoFactorProvider", Provider.Value.ToString());
|
||||
}
|
||||
|
||||
return dict;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,9 +0,0 @@
|
||||
namespace Bit.App.Models.Api
|
||||
{
|
||||
public class TokenTwoFactorRequest
|
||||
{
|
||||
public string Code { get; set; }
|
||||
public string Provider { get; set; }
|
||||
public DeviceRequest Device { get; set; }
|
||||
}
|
||||
}
|
||||
17
src/App/Models/Api/Response/DomainsResponse.cs
Normal file
@@ -0,0 +1,17 @@
|
||||
using System.Collections.Generic;
|
||||
|
||||
namespace Bit.App.Models.Api
|
||||
{
|
||||
public class DomainsResponse
|
||||
{
|
||||
public IEnumerable<IEnumerable<string>> EquivalentDomains { get; set; }
|
||||
public IEnumerable<GlobalDomains> GlobalEquivalentDomains { get; set; }
|
||||
|
||||
public class GlobalDomains
|
||||
{
|
||||
public byte Type { get; set; }
|
||||
public IEnumerable<string> Domains { get; set; }
|
||||
public bool Excluded { get; set; }
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -2,7 +2,7 @@
|
||||
|
||||
namespace Bit.App.Models.Api
|
||||
{
|
||||
public class SiteResponse
|
||||
public class LoginResponse
|
||||
{
|
||||
public string Id { get; set; }
|
||||
public string FolderId { get; set; }
|
||||
@@ -1,8 +1,18 @@
|
||||
namespace Bit.App.Models.Api
|
||||
using Newtonsoft.Json;
|
||||
using System.Collections.Generic;
|
||||
|
||||
namespace Bit.App.Models.Api
|
||||
{
|
||||
public class TokenResponse
|
||||
{
|
||||
public string Token { get; set; }
|
||||
public ProfileResponse Profile { get; set; }
|
||||
[JsonProperty("access_token")]
|
||||
public string AccessToken { get; set; }
|
||||
[JsonProperty("expires_in")]
|
||||
public long ExpiresIn { get; set; }
|
||||
[JsonProperty("refresh_token")]
|
||||
public string RefreshToken { get; set; }
|
||||
[JsonProperty("token_type")]
|
||||
public string TokenType { get; set; }
|
||||
public List<int> TwoFactorProviders { get; set; }
|
||||
}
|
||||
}
|
||||
|
||||
@@ -18,7 +18,7 @@ namespace Bit.App.Models
|
||||
EncryptedString = encryptedString;
|
||||
}
|
||||
|
||||
public CipherString(string initializationVector, string cipherText)
|
||||
public CipherString(string initializationVector, string cipherText, string mac = null)
|
||||
{
|
||||
if(string.IsNullOrWhiteSpace(initializationVector))
|
||||
{
|
||||
@@ -31,13 +31,32 @@ namespace Bit.App.Models
|
||||
}
|
||||
|
||||
EncryptedString = string.Format("{0}|{1}", initializationVector, cipherText);
|
||||
|
||||
if(!string.IsNullOrWhiteSpace(mac))
|
||||
{
|
||||
EncryptedString = string.Format("{0}|{1}", EncryptedString, mac);
|
||||
}
|
||||
}
|
||||
|
||||
public string EncryptedString { get; private set; }
|
||||
public string InitializationVector { get { return EncryptedString?.Split('|')[0]; } }
|
||||
public string CipherText { get { return EncryptedString?.Split('|')[1]; } }
|
||||
public byte[] InitializationVectorBytes { get { return Convert.FromBase64String(InitializationVector); } }
|
||||
public byte[] CipherTextBytes { get { return Convert.FromBase64String(CipherText); } }
|
||||
public string InitializationVector => EncryptedString?.Split('|')[0] ?? null;
|
||||
public string CipherText => EncryptedString?.Split('|')[1] ?? null;
|
||||
public string Mac
|
||||
{
|
||||
get
|
||||
{
|
||||
var pieces = EncryptedString?.Split('|') ?? new string[0];
|
||||
if(pieces.Length > 2)
|
||||
{
|
||||
return pieces[2];
|
||||
}
|
||||
|
||||
return null;
|
||||
}
|
||||
}
|
||||
public byte[] InitializationVectorBytes => Convert.FromBase64String(InitializationVector);
|
||||
public byte[] CipherTextBytes => Convert.FromBase64String(CipherText);
|
||||
public byte[] MacBytes => Mac == null ? null : Convert.FromBase64String(Mac);
|
||||
|
||||
public string Decrypt()
|
||||
{
|
||||
|
||||
@@ -33,7 +33,7 @@ namespace Bit.App.Models.Data
|
||||
throw new ArgumentException(nameof(cipher.Type));
|
||||
}
|
||||
|
||||
var data = cipher.Data.ToObject<SiteDataModel>();
|
||||
var data = cipher.Data.ToObject<LoginDataModel>();
|
||||
|
||||
Id = cipher.Id;
|
||||
UserId = userId;
|
||||
|
||||
@@ -6,46 +6,46 @@ using Bit.App.Models.Api;
|
||||
namespace Bit.App.Models.Data
|
||||
{
|
||||
[Table("Site")]
|
||||
public class SiteData : IDataObject<string>
|
||||
public class LoginData : IDataObject<string>
|
||||
{
|
||||
public SiteData()
|
||||
public LoginData()
|
||||
{ }
|
||||
|
||||
public SiteData(Site site, string userId)
|
||||
public LoginData(Login login, string userId)
|
||||
{
|
||||
Id = site.Id;
|
||||
FolderId = site.FolderId;
|
||||
Id = login.Id;
|
||||
FolderId = login.FolderId;
|
||||
UserId = userId;
|
||||
Name = site.Name?.EncryptedString;
|
||||
Uri = site.Uri?.EncryptedString;
|
||||
Username = site.Username?.EncryptedString;
|
||||
Password = site.Password?.EncryptedString;
|
||||
Notes = site.Notes?.EncryptedString;
|
||||
Favorite = site.Favorite;
|
||||
Name = login.Name?.EncryptedString;
|
||||
Uri = login.Uri?.EncryptedString;
|
||||
Username = login.Username?.EncryptedString;
|
||||
Password = login.Password?.EncryptedString;
|
||||
Notes = login.Notes?.EncryptedString;
|
||||
Favorite = login.Favorite;
|
||||
}
|
||||
|
||||
public SiteData(SiteResponse site, string userId)
|
||||
public LoginData(LoginResponse login, string userId)
|
||||
{
|
||||
Id = site.Id;
|
||||
FolderId = site.FolderId;
|
||||
Id = login.Id;
|
||||
FolderId = login.FolderId;
|
||||
UserId = userId;
|
||||
Name = site.Name;
|
||||
Uri = site.Uri;
|
||||
Username = site.Username;
|
||||
Password = site.Password;
|
||||
Notes = site.Notes;
|
||||
Favorite = site.Favorite;
|
||||
RevisionDateTime = site.RevisionDate;
|
||||
Name = login.Name;
|
||||
Uri = login.Uri;
|
||||
Username = login.Username;
|
||||
Password = login.Password;
|
||||
Notes = login.Notes;
|
||||
Favorite = login.Favorite;
|
||||
RevisionDateTime = login.RevisionDate;
|
||||
}
|
||||
|
||||
public SiteData(CipherResponse cipher, string userId)
|
||||
public LoginData(CipherResponse cipher, string userId)
|
||||
{
|
||||
if(cipher.Type != Enums.CipherType.Site)
|
||||
if(cipher.Type != Enums.CipherType.Login)
|
||||
{
|
||||
throw new ArgumentException(nameof(cipher.Type));
|
||||
}
|
||||
|
||||
var data = cipher.Data.ToObject<SiteDataModel>();
|
||||
var data = cipher.Data.ToObject<LoginDataModel>();
|
||||
|
||||
Id = cipher.Id;
|
||||
FolderId = cipher.FolderId;
|
||||
@@ -72,9 +72,9 @@ namespace Bit.App.Models.Data
|
||||
public bool Favorite { get; set; }
|
||||
public DateTime RevisionDateTime { get; set; } = DateTime.UtcNow;
|
||||
|
||||
public Site ToSite()
|
||||
public Login ToLogin()
|
||||
{
|
||||
return new Site(this);
|
||||
return new Login(this);
|
||||
}
|
||||
}
|
||||
}
|
||||
16
src/App/Models/Data/SettingsData.cs
Normal file
@@ -0,0 +1,16 @@
|
||||
using SQLite;
|
||||
using Bit.App.Abstractions;
|
||||
|
||||
namespace Bit.App.Models.Data
|
||||
{
|
||||
[Table("Settings")]
|
||||
public class SettingsData : IDataObject<string>
|
||||
{
|
||||
public SettingsData()
|
||||
{ }
|
||||
|
||||
[PrimaryKey]
|
||||
public string Id { get; set; }
|
||||
public string EquivalentDomains { get; set; }
|
||||
}
|
||||
}
|
||||
@@ -3,12 +3,12 @@ using Bit.App.Models.Data;
|
||||
|
||||
namespace Bit.App.Models
|
||||
{
|
||||
public class Site : Cipher
|
||||
public class Login : Cipher
|
||||
{
|
||||
public Site()
|
||||
public Login()
|
||||
{ }
|
||||
|
||||
public Site(SiteData data)
|
||||
public Login(LoginData data)
|
||||
{
|
||||
Id = data.Id;
|
||||
FolderId = data.FolderId;
|
||||
@@ -20,7 +20,7 @@ namespace Bit.App.Models
|
||||
Favorite = data.Favorite;
|
||||
}
|
||||
|
||||
public Site(SiteResponse response)
|
||||
public Login(LoginResponse response)
|
||||
{
|
||||
Id = response.Id;
|
||||
FolderId = response.FolderId;
|
||||
@@ -39,14 +39,14 @@ namespace Bit.App.Models
|
||||
public CipherString Notes { get; set; }
|
||||
public bool Favorite { get; set; }
|
||||
|
||||
public SiteRequest ToSiteRequest()
|
||||
public LoginRequest ToLoginRequest()
|
||||
{
|
||||
return new SiteRequest(this);
|
||||
return new LoginRequest(this);
|
||||
}
|
||||
|
||||
public SiteData ToSiteData(string userId)
|
||||
public LoginData ToLoginData(string userId)
|
||||
{
|
||||
return new SiteData(this, userId);
|
||||
return new LoginData(this, userId);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -6,16 +6,18 @@ namespace Bit.App.Models.Page
|
||||
{
|
||||
public class VaultListPageModel
|
||||
{
|
||||
public class Site
|
||||
public class Login
|
||||
{
|
||||
public Site(Models.Site site)
|
||||
private string _baseDomain;
|
||||
|
||||
public Login(Models.Login login)
|
||||
{
|
||||
Id = site.Id;
|
||||
FolderId = site.FolderId;
|
||||
Name = site.Name?.Decrypt();
|
||||
Username = site.Username?.Decrypt() ?? " ";
|
||||
Password = new Lazy<string>(() => site.Password?.Decrypt());
|
||||
Uri = new Lazy<string>(() => site.Uri?.Decrypt());
|
||||
Id = login.Id;
|
||||
FolderId = login.FolderId;
|
||||
Name = login.Name?.Decrypt();
|
||||
Username = login.Username?.Decrypt() ?? " ";
|
||||
Password = new Lazy<string>(() => login.Password?.Decrypt());
|
||||
Uri = new Lazy<string>(() => login.Uri?.Decrypt());
|
||||
}
|
||||
|
||||
public string Id { get; set; }
|
||||
@@ -26,7 +28,7 @@ namespace Bit.App.Models.Page
|
||||
public Lazy<string> Uri { get; set; }
|
||||
}
|
||||
|
||||
public class Folder : List<Site>
|
||||
public class Folder : List<Login>
|
||||
{
|
||||
public Folder(Models.Folder folder)
|
||||
{
|
||||
@@ -34,9 +36,9 @@ namespace Bit.App.Models.Page
|
||||
Name = folder.Name?.Decrypt();
|
||||
}
|
||||
|
||||
public Folder(List<Site> sites)
|
||||
public Folder(List<Login> logins)
|
||||
{
|
||||
AddRange(sites);
|
||||
AddRange(logins);
|
||||
}
|
||||
|
||||
public string Id { get; set; }
|
||||
|
||||
@@ -5,7 +5,7 @@ using Xamarin.Forms;
|
||||
|
||||
namespace Bit.App.Models.Page
|
||||
{
|
||||
public class VaultViewSitePageModel : INotifyPropertyChanged
|
||||
public class VaultViewLoginPageModel : INotifyPropertyChanged
|
||||
{
|
||||
private string _name;
|
||||
private string _username;
|
||||
@@ -15,7 +15,7 @@ namespace Bit.App.Models.Page
|
||||
private bool _revealPassword;
|
||||
private string _uriHost;
|
||||
|
||||
public VaultViewSitePageModel() { }
|
||||
public VaultViewLoginPageModel() { }
|
||||
|
||||
public event PropertyChangedEventHandler PropertyChanged;
|
||||
|
||||
@@ -36,9 +36,31 @@ namespace Bit.App.Models.Page
|
||||
_username = value;
|
||||
PropertyChanged(this, new PropertyChangedEventArgs(nameof(Username)));
|
||||
PropertyChanged(this, new PropertyChangedEventArgs(nameof(ShowUsername)));
|
||||
PropertyChanged(this, new PropertyChangedEventArgs(nameof(UsernameFontSize)));
|
||||
}
|
||||
}
|
||||
public bool ShowUsername => !string.IsNullOrWhiteSpace(Username);
|
||||
public double UsernameFontSize
|
||||
{
|
||||
get
|
||||
{
|
||||
if(Device.OS == TargetPlatform.Android)
|
||||
{
|
||||
var length = Username?.Length ?? 0;
|
||||
|
||||
if(length > 35)
|
||||
{
|
||||
return Device.GetNamedSize(NamedSize.Micro, typeof(Label));
|
||||
}
|
||||
else if(length > 25)
|
||||
{
|
||||
return Device.GetNamedSize(NamedSize.Small, typeof(Label));
|
||||
}
|
||||
}
|
||||
|
||||
return Device.GetNamedSize(NamedSize.Medium, typeof(Label));
|
||||
}
|
||||
}
|
||||
|
||||
public string Password
|
||||
{
|
||||
@@ -48,9 +70,32 @@ namespace Bit.App.Models.Page
|
||||
_password = value;
|
||||
PropertyChanged(this, new PropertyChangedEventArgs(nameof(Password)));
|
||||
PropertyChanged(this, new PropertyChangedEventArgs(nameof(MaskedPassword)));
|
||||
PropertyChanged(this, new PropertyChangedEventArgs(nameof(ShowPassword)));
|
||||
PropertyChanged(this, new PropertyChangedEventArgs(nameof(PasswordFontSize)));
|
||||
}
|
||||
}
|
||||
public bool ShowPassword => !string.IsNullOrWhiteSpace(Password);
|
||||
public double PasswordFontSize
|
||||
{
|
||||
get
|
||||
{
|
||||
if(Device.OS == TargetPlatform.Android)
|
||||
{
|
||||
var length = Password?.Length ?? 0;
|
||||
|
||||
if(length > 25)
|
||||
{
|
||||
return Device.GetNamedSize(NamedSize.Micro, typeof(Label));
|
||||
}
|
||||
else if(length > 20)
|
||||
{
|
||||
return Device.GetNamedSize(NamedSize.Small, typeof(Label));
|
||||
}
|
||||
}
|
||||
|
||||
return Device.GetNamedSize(NamedSize.Medium, typeof(Label));
|
||||
}
|
||||
}
|
||||
|
||||
public string Uri
|
||||
{
|
||||
@@ -131,13 +176,13 @@ namespace Bit.App.Models.Page
|
||||
public string ShowHideText => RevealPassword ? AppResources.Hide : AppResources.Show;
|
||||
public ImageSource ShowHideImage => RevealPassword ? ImageSource.FromFile("eye_slash") : ImageSource.FromFile("eye");
|
||||
|
||||
public void Update(Site site)
|
||||
public void Update(Login login)
|
||||
{
|
||||
Name = site.Name?.Decrypt();
|
||||
Username = site.Username?.Decrypt();
|
||||
Password = site.Password?.Decrypt();
|
||||
Uri = site.Uri?.Decrypt();
|
||||
Notes = site.Notes?.Decrypt();
|
||||
Name = login.Name?.Decrypt();
|
||||
Username = login.Username?.Decrypt();
|
||||
Password = login.Password?.Decrypt();
|
||||
Uri = login.Uri?.Decrypt();
|
||||
Notes = login.Notes?.Decrypt();
|
||||
}
|
||||
}
|
||||
}
|
||||