2
0
mirror of https://github.com/KDE/kdeconnect-android synced 2025-09-01 22:55:10 +00:00

Compare commits

...

60 Commits
v0.1 ... v0.4

Author SHA1 Message Date
Albert Vaca
30d2665b12 Upgraded project to new Android SDK
Now using gradle magic imports instead of jar files for libraries
2013-11-02 17:46:20 +01:00
l10n daemon script
c14946e9e4 SVN_SILENT made messages (after extraction) 2013-11-02 01:35:34 +00:00
l10n daemon script
1aab14fd50 SVN_SILENT made messages (after extraction) 2013-10-31 01:37:52 +00:00
l10n daemon script
549fc01c1d SVN_SILENT made messages (after extraction) 2013-10-30 01:42:44 +00:00
Albert Vaca
d59de8a0b6 Increased version to release 2013-10-30 01:46:00 +01:00
Mauro Panzeri
8823277e74 Follow the android guidelines for icons/drawables and their names.
Guidelines: http://goo.gl/E70Ez

REVIEW: 113200
2013-10-30 01:45:27 +01:00
Albert Vaca
30cf27e835 NetworkPackage.encrypt now returns a new package instead of changing itself
This was causing problems with plugins that keep a reference to the
packages they have already sent, like the telephony plugin, because the
package became encrypted (and thus inaccessible) after sending it.

BUG: 326275
2013-10-30 01:37:55 +01:00
Mauro Panzeri
9dbe1ec9cf Added a settings activity to change the publicly visible device name
When changed the new name will be used instead of the one from
HumanDeviceNames

REVIEW: 113204
BUG: 325061
2013-10-30 01:37:47 +01:00
Albert Vaca
0595662efc Spotify doesn't support seeking, disable mpris seek buttons for it 2013-10-30 01:31:21 +01:00
Albert Vaca
6609ae665c Fixed a crash trying to disconnect not-yet-active sessions. 2013-10-30 01:31:20 +01:00
Maksim Krylosov
2f26fa5188 Added rewind and fast-forward buttons to MPRIS controls 2013-10-30 01:31:20 +01:00
Albert Vaca
6471bafdd9 Fixed important bug trying to load device settings before deviceId was set
(Also improved code style and fixed minor TODOs)
2013-10-30 01:31:20 +01:00
Albert Vaca
0620810e4b Upgraded to build tools 18.1.1 and gradle 1.8 2013-10-30 01:31:20 +01:00
Albert Vaca
db9209765d Android Studio is getting confused if project name != directory name 2013-10-29 17:47:07 +01:00
Mauro Panzeri
e459d792d0 "Share to" now retrieves filename for file:// uris too
Querying the ContentProvider only works for content://... uris but when you
share a file from a file-manager, the uri you get has the form file://... and
ContentProvider returns a null cursor.

BUG: 325684
REVIEW: 113202
2013-10-29 17:47:07 +01:00
Albert Vaca
31fcc3e184 Project refactor because Android Studio was not able to open it
For some reason it was not detecting the directory as an Android project
Android Build Tools version increased from 18.0.1 to 18.1
2013-10-29 17:47:07 +01:00
l10n daemon script
544b5e8c87 SVN_SILENT made messages (after extraction) 2013-10-25 01:35:28 +00:00
l10n daemon script
7819ae1ca2 SVN_SILENT made messages (after extraction) 2013-10-18 01:44:45 +00:00
l10n daemon script
98885d6c35 SVN_SILENT made messages (after extraction) 2013-10-17 01:34:48 +00:00
l10n daemon script
485e646f6f SVN_SILENT made messages (after extraction) 2013-10-14 01:51:48 +00:00
l10n daemon script
dfece0a414 SVN_SILENT made messages (after extraction) 2013-10-11 01:53:05 +00:00
l10n daemon script
bbaf40165c SVN_SILENT made messages (after extraction) 2013-10-07 01:47:28 +00:00
Albert Vaca
b221fa04bf Increased version number for release 2013-10-05 17:26:51 +02:00
Albert Vaca
07bf1e9ebc Made sendPackage sync, so mutex hack in Device is no longer needed 2013-10-05 17:26:51 +02:00
Albert Vaca
a07c9a9fb7 Fixed warnings about cursors not closed 2013-10-05 17:26:51 +02:00
l10n daemon script
40a9171985 SVN_SILENT made messages (after extraction) 2013-10-04 01:52:34 +00:00
Albert Vaca
69197fd657 Increased version for release. 2013-10-03 15:52:10 +02:00
Albert Vaca
55e3861c5c Fixed a crash when pressing back from remote controls in action bar
Device activity isn't receiving the device id in that case.
2013-10-03 15:52:10 +02:00
Albert Vaca
5d00e6e168 Added a mutex to avoid files being sent all at the same time
It's a bit hackish but works.
2013-10-03 15:52:09 +02:00
l10n daemon script
967635a2f4 SVN_SILENT made messages (after extraction) 2013-10-03 01:46:02 +00:00
Albert Astals Cid
58b31fa032 Transition to the StaticMessages.sh thing
Let's see what next scripty run says
CCMAIL: albertvaka@gmail.com
2013-10-01 21:52:09 +02:00
Albert Vaca
f0d06cfcc4 Added license file 2013-10-01 14:35:30 +02:00
Albert Vaca
0fe3b6cd1e Increased version number to release on Google Play 2013-10-01 03:34:08 +02:00
Albert Vaca
f8f58ef2a2 Merge branch 'filetransfer' 2013-10-01 03:29:51 +02:00
Albert Vaca
d66f8442fa Commented raw json debug output 2013-10-01 03:28:12 +02:00
Albert Vaca
4b3af91c71 Commented app icon sending code of notifications plugin
Because it was not used from desktop
2013-10-01 03:27:48 +02:00
Albert Vaca
87174cfb28 Renamed kdeconnect.filetransfer to kdeconnect.share 2013-10-01 03:25:18 +02:00
Albert Vaca
3517035605 Store device's protocol version and show a warning if it doesn't match 2013-10-01 03:24:42 +02:00
Albert Vaca
37c2a0e112 Added multi-file transfer and query for filename and file size 2013-09-27 02:58:16 +02:00
Albert Vaca
754123b9c5 Fixed bugs with file transfers
Finding open ports was not working (socked became closed after first try)
AsyncTask on Device's sendPackage was blocking execution when stuck sending
2013-09-27 00:07:14 +02:00
Albert Vaca
fa11204365 Added Messages.sh 2013-09-20 19:05:49 +02:00
Albert Vaca
7cd5b905be Moved sharetoreceiver
Removed buggish cursor code, causing null pointer exception
2013-09-20 19:05:04 +02:00
Albert Vaca
cda2f573bf Merge branch 'master' into filetransfer
Conflicts:
	KdeConnect/src/main/AndroidManifest.xml
2013-09-20 17:27:59 +02:00
Albert Vaca
50cb2b9f7f Implemented ShareToReceiver to send files 2013-09-20 16:12:24 +02:00
Albert Vaca
513a2b32f4 Fixed file transfer (both lan and loopback)
Added file size to protocol (optional)
Increased protocol version to 5
2013-09-20 16:12:24 +02:00
Albert Vaca
1757b2e650 Share menu now displays "KDE Connect" instead of "Share to" 2013-09-20 16:12:24 +02:00
Albert Vaca
091836646a Added a simple kind of item (only a title) for the generic item list 2013-09-20 16:12:24 +02:00
Albert Vaca
0d8f84037b Added a send to activity (untested at all) 2013-09-20 16:12:24 +02:00
Albert Vaca
aabd06f5cb Notifications plugin now uses payloads to send app icons (untested) 2013-09-20 16:12:23 +02:00
Albert Vaca
6dbe7bac91 Implemented payload transfer in LanLink (untested)
Some silly fixes to NetworkPackage added too
2013-09-20 16:12:23 +02:00
Albert Vaca
593cf8cac0 Added missing getter and setter in NetworkPackage 2013-09-20 16:12:23 +02:00
Albert Vaca
46ad74f539 Payload transfer in loopback link (not tested) 2013-09-20 16:12:23 +02:00
Albert Vaca
66766e8ab0 Added payload to NetworkPackage
Matching KDED's implementation
2013-09-20 16:12:23 +02:00
Albert Vaca
34fe3ac272 Refactor to move backend to its own package
Matching kde project structure
2013-09-20 16:12:23 +02:00
Albert Vaca
8800c4503c Parent activities where not correctly set
BUG: 325060
2013-09-20 15:58:18 +02:00
Albert Vaca
5200ceaab5 Commented loopbacklinkprovider 2013-09-20 15:58:18 +02:00
Albert Vaca
6a9419401e Project changed 2013-09-18 18:04:20 +02:00
Albert Vaca
b1ca8757c6 Parent activities where not correctly set
BUG: 325060
2013-09-18 17:28:43 +02:00
Albert Vaca
e735e0ecf3 Moved cryptography layer down from Device to Backend
Matching KDED structure
2013-09-16 17:36:26 +02:00
Albert Vaca
63f0458096 Refactor to move backend to its own package
Matching kde project structure
2013-09-16 15:24:21 +02:00
97 changed files with 2446 additions and 552 deletions

9
.gitignore vendored
View File

@@ -1,4 +1,7 @@
local.properties
.gradle
.idea
out
.gradle/
.idea/
out/
build/
target/
classes/

339
COPYING Normal file
View File

@@ -0,0 +1,339 @@
GNU GENERAL PUBLIC LICENSE
Version 2, June 1991
Copyright (C) 1989, 1991 Free Software Foundation, Inc.,
51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
Everyone is permitted to copy and distribute verbatim copies
of this license document, but changing it is not allowed.
Preamble
The licenses for most software are designed to take away your
freedom to share and change it. By contrast, the GNU General Public
License is intended to guarantee your freedom to share and change free
software--to make sure the software is free for all its users. This
General Public License applies to most of the Free Software
Foundation's software and to any other program whose authors commit to
using it. (Some other Free Software Foundation software is covered by
the GNU Lesser General Public License instead.) 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
this service 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 make restrictions that forbid
anyone to deny you these rights or to ask you to surrender the rights.
These restrictions translate to certain responsibilities for you if you
distribute copies of the software, or if you modify it.
For example, if you distribute copies of such a program, whether
gratis or for a fee, you must give the recipients all the rights that
you have. 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.
We protect your rights with two steps: (1) copyright the software, and
(2) offer you this license which gives you legal permission to copy,
distribute and/or modify the software.
Also, for each author's protection and ours, we want to make certain
that everyone understands that there is no warranty for this free
software. If the software is modified by someone else and passed on, we
want its recipients to know that what they have is not the original, so
that any problems introduced by others will not reflect on the original
authors' reputations.
Finally, any free program is threatened constantly by software
patents. We wish to avoid the danger that redistributors of a free
program will individually obtain patent licenses, in effect making the
program proprietary. To prevent this, we have made it clear that any
patent must be licensed for everyone's free use or not licensed at all.
The precise terms and conditions for copying, distribution and
modification follow.
GNU GENERAL PUBLIC LICENSE
TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION
0. This License applies to any program or other work which contains
a notice placed by the copyright holder saying it may be distributed
under the terms of this General Public License. The "Program", below,
refers to any such program or work, and a "work based on the Program"
means either the Program or any derivative work under copyright law:
that is to say, a work containing the Program or a portion of it,
either verbatim or with modifications and/or translated into another
language. (Hereinafter, translation is included without limitation in
the term "modification".) Each licensee is addressed as "you".
Activities other than copying, distribution and modification are not
covered by this License; they are outside its scope. The act of
running the Program is not restricted, and the output from the Program
is covered only if its contents constitute a work based on the
Program (independent of having been made by running the Program).
Whether that is true depends on what the Program does.
1. You may copy and distribute 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 and disclaimer of warranty; keep intact all the
notices that refer to this License and to the absence of any warranty;
and give any other recipients of the Program a copy of this License
along with the Program.
You may charge a fee for the physical act of transferring a copy, and
you may at your option offer warranty protection in exchange for a fee.
2. You may modify your copy or copies of the Program or any portion
of it, thus forming a work based on the Program, and copy and
distribute such modifications or work under the terms of Section 1
above, provided that you also meet all of these conditions:
a) You must cause the modified files to carry prominent notices
stating that you changed the files and the date of any change.
b) You must cause any work that you distribute or publish, that in
whole or in part contains or is derived from the Program or any
part thereof, to be licensed as a whole at no charge to all third
parties under the terms of this License.
c) If the modified program normally reads commands interactively
when run, you must cause it, when started running for such
interactive use in the most ordinary way, to print or display an
announcement including an appropriate copyright notice and a
notice that there is no warranty (or else, saying that you provide
a warranty) and that users may redistribute the program under
these conditions, and telling the user how to view a copy of this
License. (Exception: if the Program itself is interactive but
does not normally print such an announcement, your work based on
the Program is not required to print an announcement.)
These requirements apply to the modified work as a whole. If
identifiable sections of that work are not derived from the Program,
and can be reasonably considered independent and separate works in
themselves, then this License, and its terms, do not apply to those
sections when you distribute them as separate works. But when you
distribute the same sections as part of a whole which is a work based
on the Program, the distribution of the whole must be on the terms of
this License, whose permissions for other licensees extend to the
entire whole, and thus to each and every part regardless of who wrote it.
Thus, it is not the intent of this section to claim rights or contest
your rights to work written entirely by you; rather, the intent is to
exercise the right to control the distribution of derivative or
collective works based on the Program.
In addition, mere aggregation of another work not based on the Program
with the Program (or with a work based on the Program) on a volume of
a storage or distribution medium does not bring the other work under
the scope of this License.
3. You may copy and distribute the Program (or a work based on it,
under Section 2) in object code or executable form under the terms of
Sections 1 and 2 above provided that you also do one of the following:
a) Accompany it with the complete corresponding machine-readable
source code, which must be distributed under the terms of Sections
1 and 2 above on a medium customarily used for software interchange; or,
b) Accompany it with a written offer, valid for at least three
years, to give any third party, for a charge no more than your
cost of physically performing source distribution, a complete
machine-readable copy of the corresponding source code, to be
distributed under the terms of Sections 1 and 2 above on a medium
customarily used for software interchange; or,
c) Accompany it with the information you received as to the offer
to distribute corresponding source code. (This alternative is
allowed only for noncommercial distribution and only if you
received the program in object code or executable form with such
an offer, in accord with Subsection b above.)
The source code for a work means the preferred form of the work for
making modifications to it. For an executable work, complete source
code means all the source code for all modules it contains, plus any
associated interface definition files, plus the scripts used to
control compilation and installation of the executable. However, as a
special exception, the source code distributed need not include
anything that is normally distributed (in either source or binary
form) with the major components (compiler, kernel, and so on) of the
operating system on which the executable runs, unless that component
itself accompanies the executable.
If distribution of executable or object code is made by offering
access to copy from a designated place, then offering equivalent
access to copy the source code from the same place counts as
distribution of the source code, even though third parties are not
compelled to copy the source along with the object code.
4. You may not copy, modify, sublicense, or distribute the Program
except as expressly provided under this License. Any attempt
otherwise to copy, modify, sublicense or distribute the Program is
void, and will automatically terminate your rights under this License.
However, parties who have received copies, or rights, from you under
this License will not have their licenses terminated so long as such
parties remain in full compliance.
5. You are not required to accept this License, since you have not
signed it. However, nothing else grants you permission to modify or
distribute the Program or its derivative works. These actions are
prohibited by law if you do not accept this License. Therefore, by
modifying or distributing the Program (or any work based on the
Program), you indicate your acceptance of this License to do so, and
all its terms and conditions for copying, distributing or modifying
the Program or works based on it.
6. Each time you redistribute the Program (or any work based on the
Program), the recipient automatically receives a license from the
original licensor to copy, distribute or modify the Program subject to
these terms and conditions. You may not impose any further
restrictions on the recipients' exercise of the rights granted herein.
You are not responsible for enforcing compliance by third parties to
this License.
7. If, as a consequence of a court judgment or allegation of patent
infringement or for any other reason (not limited to patent issues),
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
distribute so as to satisfy simultaneously your obligations under this
License and any other pertinent obligations, then as a consequence you
may not distribute the Program at all. For example, if a patent
license would not permit royalty-free redistribution of the Program by
all those who receive copies directly or indirectly through you, then
the only way you could satisfy both it and this License would be to
refrain entirely from distribution of the Program.
If any portion of this section is held invalid or unenforceable under
any particular circumstance, the balance of the section is intended to
apply and the section as a whole is intended to apply in other
circumstances.
It is not the purpose of this section to induce you to infringe any
patents or other property right claims or to contest validity of any
such claims; this section has the sole purpose of protecting the
integrity of the free software distribution system, which is
implemented by public license practices. Many people have made
generous contributions to the wide range of software distributed
through that system in reliance on consistent application of that
system; it is up to the author/donor to decide if he or she is willing
to distribute software through any other system and a licensee cannot
impose that choice.
This section is intended to make thoroughly clear what is believed to
be a consequence of the rest of this License.
8. If the distribution and/or use of the Program is restricted in
certain countries either by patents or by copyrighted interfaces, the
original copyright holder who places the Program under this License
may add an explicit geographical distribution limitation excluding
those countries, so that distribution is permitted only in or among
countries not thus excluded. In such case, this License incorporates
the limitation as if written in the body of this License.
9. The Free Software Foundation may publish revised and/or new versions
of the 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 a version number of this License which applies to it and "any
later version", you have the option of following the terms and conditions
either of that version or of any later version published by the Free
Software Foundation. If the Program does not specify a version number of
this License, you may choose any version ever published by the Free Software
Foundation.
10. If you wish to incorporate parts of the Program into other free
programs whose distribution conditions are different, write to the author
to ask for permission. For software which is copyrighted by the Free
Software Foundation, write to the Free Software Foundation; we sometimes
make exceptions for this. Our decision will be guided by the two goals
of preserving the free status of all derivatives of our free software and
of promoting the sharing and reuse of software generally.
NO WARRANTY
11. BECAUSE THE PROGRAM IS LICENSED FREE OF CHARGE, 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.
12. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING
WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY AND/OR
REDISTRIBUTE 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.
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
convey 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 2 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, write to the Free Software Foundation, Inc.,
51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
Also add information on how to contact you by electronic and paper mail.
If the program is interactive, make it output a short notice like this
when it starts in an interactive mode:
Gnomovision version 69, Copyright (C) year name of author
Gnomovision 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, the commands you use may
be called something other than `show w' and `show c'; they could even be
mouse-clicks or menu items--whatever suits your program.
You should also get your employer (if you work as a programmer) or your
school, if any, to sign a "copyright disclaimer" for the program, if
necessary. Here is a sample; alter the names:
Yoyodyne, Inc., hereby disclaims all copyright interest in the program
`Gnomovision' (which makes passes at compilers) written by James Hacker.
<signature of Ty Coon>, 1 April 1989
Ty Coon, President of Vice
This 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.

View File

@@ -1 +0,0 @@
build/

View File

@@ -1,79 +0,0 @@
<?xml version="1.0" encoding="UTF-8"?>
<module external.linked.project.path="$MODULE_DIR$" external.system.id="GRADLE" type="JAVA_MODULE" version="4">
<component name="FacetManager">
<facet type="android" name="Android">
<configuration>
<option name="SELECTED_BUILD_VARIANT" value="Debug" />
<option name="ASSEMBLE_TASK_NAME" value="assembleDebug" />
<option name="ASSEMBLE_TEST_TASK_NAME" value="assembleTest" />
<option name="SOURCE_GEN_TASK_NAME" value="TODO" />
<option name="ALLOW_USER_CONFIGURATION" value="false" />
<option name="MANIFEST_FILE_RELATIVE_PATH" value="/src/main/AndroidManifest.xml" />
<option name="RES_FOLDER_RELATIVE_PATH" value="/src/main/res" />
<option name="RES_FOLDERS_RELATIVE_PATH" value="file://$MODULE_DIR$/src/main/res" />
<option name="ASSETS_FOLDER_RELATIVE_PATH" value="/src/main/assets" />
</configuration>
</facet>
<facet type="android-gradle" name="Android-Gradle">
<configuration>
<option name="GRADLE_PROJECT_PATH" value=":KdeConnect" />
</configuration>
</facet>
</component>
<component name="NewModuleRootManager" inherit-compiler-output="false">
<output url="file://$MODULE_DIR$/build/classes/debug" />
<exclude-output />
<content url="file://$MODULE_DIR$">
<sourceFolder url="file://$MODULE_DIR$/build/source/r/debug" isTestSource="false" />
<sourceFolder url="file://$MODULE_DIR$/build/source/aidl/debug" isTestSource="false" />
<sourceFolder url="file://$MODULE_DIR$/build/source/rs/debug" isTestSource="false" />
<sourceFolder url="file://$MODULE_DIR$/build/source/buildConfig/debug" isTestSource="false" />
<sourceFolder url="file://$MODULE_DIR$/build/res/rs/debug" isTestSource="false" />
<sourceFolder url="file://$MODULE_DIR$/build/source/r/test" isTestSource="true" />
<sourceFolder url="file://$MODULE_DIR$/build/source/aidl/test" isTestSource="true" />
<sourceFolder url="file://$MODULE_DIR$/build/source/rs/test" isTestSource="true" />
<sourceFolder url="file://$MODULE_DIR$/build/source/buildConfig/test" isTestSource="true" />
<sourceFolder url="file://$MODULE_DIR$/build/res/rs/test" isTestSource="true" />
<sourceFolder url="file://$MODULE_DIR$/src/debug/aidl" isTestSource="false" />
<sourceFolder url="file://$MODULE_DIR$/src/debug/assets" isTestSource="false" />
<sourceFolder url="file://$MODULE_DIR$/src/debug/java" isTestSource="false" />
<sourceFolder url="file://$MODULE_DIR$/src/debug/jni" isTestSource="false" />
<sourceFolder url="file://$MODULE_DIR$/src/debug/rs" isTestSource="false" />
<sourceFolder url="file://$MODULE_DIR$/src/debug/res" isTestSource="false" />
<sourceFolder url="file://$MODULE_DIR$/src/debug/resources" isTestSource="false" />
<sourceFolder url="file://$MODULE_DIR$/src/main/aidl" isTestSource="false" />
<sourceFolder url="file://$MODULE_DIR$/src/main/assets" isTestSource="false" />
<sourceFolder url="file://$MODULE_DIR$/src/main/java" isTestSource="false" />
<sourceFolder url="file://$MODULE_DIR$/src/main/jni" isTestSource="false" />
<sourceFolder url="file://$MODULE_DIR$/src/main/rs" isTestSource="false" />
<sourceFolder url="file://$MODULE_DIR$/src/main/res" isTestSource="false" />
<sourceFolder url="file://$MODULE_DIR$/src/main/resources" isTestSource="false" />
<sourceFolder url="file://$MODULE_DIR$/src/instrumentTest/aidl" isTestSource="true" />
<sourceFolder url="file://$MODULE_DIR$/src/instrumentTest/assets" isTestSource="true" />
<sourceFolder url="file://$MODULE_DIR$/src/instrumentTest/java" isTestSource="true" />
<sourceFolder url="file://$MODULE_DIR$/src/instrumentTest/jni" isTestSource="true" />
<sourceFolder url="file://$MODULE_DIR$/src/instrumentTest/rs" isTestSource="true" />
<sourceFolder url="file://$MODULE_DIR$/src/instrumentTest/res" isTestSource="true" />
<sourceFolder url="file://$MODULE_DIR$/src/instrumentTest/resources" isTestSource="true" />
<excludeFolder url="file://$MODULE_DIR$/build/apk" />
<excludeFolder url="file://$MODULE_DIR$/build/assets" />
<excludeFolder url="file://$MODULE_DIR$/build/bundles" />
<excludeFolder url="file://$MODULE_DIR$/build/classes" />
<excludeFolder url="file://$MODULE_DIR$/build/dependency-cache" />
<excludeFolder url="file://$MODULE_DIR$/build/exploded-bundles" />
<excludeFolder url="file://$MODULE_DIR$/build/incremental" />
<excludeFolder url="file://$MODULE_DIR$/build/libs" />
<excludeFolder url="file://$MODULE_DIR$/build/manifests" />
<excludeFolder url="file://$MODULE_DIR$/build/symbols" />
<excludeFolder url="file://$MODULE_DIR$/build/tmp" />
</content>
<orderEntry type="jdk" jdkName="Android 4.3 Platform" jdkType="Android SDK" />
<orderEntry type="sourceFolder" forTests="false" />
<orderEntry type="library" exported="" name="android-support-v4" level="project" />
<orderEntry type="library" exported="" name="mina-core-2.0.7" level="project" />
<orderEntry type="library" exported="" name="slf4j-api-1.6.6" level="project" />
<orderEntry type="library" exported="" name="support-v4-18.0.0" level="project" />
<orderEntry type="library" exported="" name="ComAndroidSupportAppcompatV71800.aar" level="project" />
</component>
</module>

View File

@@ -1,26 +0,0 @@
buildscript {
repositories {
mavenCentral()
}
dependencies {
classpath 'com.android.tools.build:gradle:0.5.+'
}
}
apply plugin: 'android'
dependencies {
compile "com.android.support:appcompat-v7:18.0.+"
compile files('libs/android-support-v4.jar')
compile files('libs/mina-core-2.0.7.jar')
compile files('libs/slf4j-api-1.6.6.jar')
}
android {
compileSdkVersion 18
buildToolsVersion "18.0.1"
defaultConfig {
minSdkVersion 9
targetSdkVersion 18
}
}

Binary file not shown.

Binary file not shown.

View File

@@ -1,37 +0,0 @@
package org.kde.kdeconnect.ComputerLinks;
import android.util.Log;
import org.apache.mina.core.session.IoSession;
import org.kde.kdeconnect.LinkProviders.BaseLinkProvider;
import org.kde.kdeconnect.NetworkPackage;
public class LanComputerLink extends BaseComputerLink {
private IoSession session = null;
public void disconnect() {
Log.i("LanComputerLink","Disconnect: "+session.getRemoteAddress().toString());
session.close(true);
}
public LanComputerLink(IoSession session, String deviceId, BaseLinkProvider linkProvider) {
super(deviceId, linkProvider);
this.session = session;
}
@Override
public boolean sendPackage(NetworkPackage np) {
if (session == null) {
Log.e("LanComputerLink","sendPackage failed: not yet connected");
return false;
} else {
session.write(np.serialize());
return true;
}
}
public void injectNetworkPackage(NetworkPackage np) {
packageReceived(np);
}
}

View File

@@ -1,23 +0,0 @@
package org.kde.kdeconnect.ComputerLinks;
import android.util.Log;
import org.apache.mina.core.session.IoSession;
import org.kde.kdeconnect.LinkProviders.BaseLinkProvider;
import org.kde.kdeconnect.NetworkPackage;
public class LoopbackComputerLink extends BaseComputerLink {
public LoopbackComputerLink(BaseLinkProvider linkProvider) {
super("loopback", linkProvider);
}
@Override
public boolean sendPackage(NetworkPackage in) {
String s = in.serialize();
NetworkPackage out= NetworkPackage.unserialize(s);
packageReceived(out);
return true;
}
}

View File

@@ -1,65 +0,0 @@
package org.kde.kdeconnect.LinkProviders;
import android.content.Context;
import android.os.AsyncTask;
import android.util.Log;
import org.apache.mina.core.future.ConnectFuture;
import org.apache.mina.core.future.IoFuture;
import org.apache.mina.core.future.IoFutureListener;
import org.apache.mina.core.service.IoHandler;
import org.apache.mina.core.service.IoHandlerAdapter;
import org.apache.mina.core.session.IoSession;
import org.apache.mina.filter.codec.ProtocolCodecFilter;
import org.apache.mina.filter.codec.textline.LineDelimiter;
import org.apache.mina.filter.codec.textline.TextLineCodecFactory;
import org.apache.mina.transport.socket.nio.NioDatagramAcceptor;
import org.apache.mina.transport.socket.nio.NioSocketAcceptor;
import org.apache.mina.transport.socket.nio.NioSocketConnector;
import org.kde.kdeconnect.ComputerLinks.LanComputerLink;
import org.kde.kdeconnect.ComputerLinks.LoopbackComputerLink;
import org.kde.kdeconnect.NetworkPackage;
import java.net.DatagramPacket;
import java.net.DatagramSocket;
import java.net.InetAddress;
import java.net.InetSocketAddress;
import java.nio.charset.Charset;
import java.util.HashMap;
public class LoopbackLinkProvider extends BaseLinkProvider {
private Context context;
public LoopbackLinkProvider(Context context) {
this.context = context;
}
@Override
public void onStart() {
onNetworkChange();
}
@Override
public void onStop() {
}
@Override
public void onNetworkChange() {
NetworkPackage np = NetworkPackage.createIdentityPackage(context);
connectionAccepted(np, new LoopbackComputerLink(this));
}
@Override
public int getPriority() {
return 0;
}
@Override
public String getName() {
return "LoopbackLinkProvider";
}
}

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.6 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 3.1 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.6 KiB

View File

@@ -1,48 +0,0 @@
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="fill_parent"
android:baselineAligned="false"
android:layout_height="wrap_content"
android:minHeight="?android:attr/listPreferredItemHeight"
android:gravity="center_vertical"
android:paddingRight="?android:attr/scrollbarSize">
<!--
<ImageView
android:id="@+id/list_item_entry_drawable"
android:layout_width="wrap_content"
android:layout_height="fill_parent"
android:src="@android:drawable/ic_menu_preferences"
android:paddingLeft="9dp"/>
<RelativeLayout
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:layout_marginLeft="10dip"
android:layout_marginRight="6dip"
android:layout_marginTop="3dip"
android:layout_marginBottom="3dip"
android:layout_weight="0">
-->
<TextView android:id="@+id/list_item_entry_title"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:singleLine="true"
android:textAppearance="?android:attr/textAppearanceLarge"
android:ellipsize="marquee"
android:fadingEdge="horizontal" />
<!--
<TextView android:id="@+id/list_item_entry_summary"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_below="@id/list_item_entry_title"
android:layout_alignLeft="@id/list_item_entry_title"
android:textAppearance="?android:attr/textAppearanceSmall"
android:singleLine="true"
android:textColor="?android:attr/textColorSecondary" />
</RelativeLayout>
-->
</LinearLayout>

21
StaticMessages.sh Normal file
View File

@@ -0,0 +1,21 @@
#!/usr/bin/env bash
# The name of catalog we create (without the.pot extension), sourced from the scripty scripts
FILENAME="kdeconnect-android"
function export_pot_file # First parameter will be the path of the pot file we have to create, includes $FILENAME
{
potfile=$1
mkdir outdir
a2po export --android src/main/res/ --gettext outdir
mv outdir/template.pot $potfile
rm -rf outdir
}
function import_po_files # First parameter will be a path that will contain several .po files with the format LANG.po
{
podir=$1
a2po import --android src/main/res/ --gettext $podir
}

View File

@@ -1,2 +1,29 @@
// Top-level build file where you can add configuration options common to all sub-projects/modules.
buildscript {
repositories {
mavenCentral()
}
dependencies {
classpath 'com.android.tools.build:gradle:0.6.+'
}
}
apply plugin: 'android'
android {
compileSdkVersion 19
buildToolsVersion "19"
defaultConfig {
minSdkVersion 9
targetSdkVersion 19
}
}
dependencies {
repositories {
mavenCentral()
}
compile "com.android.support:support-v4:19.0.+"
compile "com.android.support:appcompat-v7:19.0.+"
compile "org.apache.mina:mina-core:2.0.+"
}

View File

@@ -1,6 +1,6 @@
#Wed Apr 10 15:27:10 PDT 2013
#Tue Oct 29 15:58:14 CET 2013
distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists
distributionUrl=http\://services.gradle.org/distributions/gradle-1.6-bin.zip
distributionUrl=http\://services.gradle.org/distributions/gradle-1.8-all.zip

View File

@@ -1,13 +1,81 @@
<?xml version="1.0" encoding="UTF-8"?>
<module external.linked.project.path="$MODULE_DIR$" external.system.id="GRADLE" type="JAVA_MODULE" version="4">
<component name="NewModuleRootManager" inherit-compiler-output="true">
<module external.linked.project.path="$MODULE_DIR$" external.root.project.path="$MODULE_DIR$" external.system.id="GRADLE" type="JAVA_MODULE" version="4">
<component name="FacetManager">
<facet type="android" name="Android">
<configuration>
<option name="SELECTED_BUILD_VARIANT" value="Debug" />
<option name="ASSEMBLE_TASK_NAME" value="assembleDebug" />
<option name="COMPILE_JAVA_TASK_NAME" value="compileDebug" />
<option name="ASSEMBLE_TEST_TASK_NAME" value="assembleTest" />
<option name="SOURCE_GEN_TASK_NAME" value="generateDebugSources" />
<option name="ALLOW_USER_CONFIGURATION" value="false" />
<option name="MANIFEST_FILE_RELATIVE_PATH" value="/src/main/AndroidManifest.xml" />
<option name="RES_FOLDER_RELATIVE_PATH" value="/src/main/res" />
<option name="RES_FOLDERS_RELATIVE_PATH" value="file://$MODULE_DIR$/src/main/res" />
<option name="ASSETS_FOLDER_RELATIVE_PATH" value="/src/main/assets" />
</configuration>
</facet>
<facet type="android-gradle" name="Android-Gradle">
<configuration>
<option name="GRADLE_PROJECT_PATH" value=":" />
</configuration>
</facet>
</component>
<component name="NewModuleRootManager" inherit-compiler-output="false">
<output url="file://$MODULE_DIR$/build/classes/debug" />
<exclude-output />
<content url="file://$MODULE_DIR$">
<sourceFolder url="file://$MODULE_DIR$/build/source/r/debug" isTestSource="false" />
<sourceFolder url="file://$MODULE_DIR$/build/source/aidl/debug" isTestSource="false" />
<sourceFolder url="file://$MODULE_DIR$/build/source/rs/debug" isTestSource="false" />
<sourceFolder url="file://$MODULE_DIR$/build/source/buildConfig/debug" isTestSource="false" />
<sourceFolder url="file://$MODULE_DIR$/build/res/rs/debug" isTestSource="false" />
<sourceFolder url="file://$MODULE_DIR$/build/source/r/test" isTestSource="true" />
<sourceFolder url="file://$MODULE_DIR$/build/source/aidl/test" isTestSource="true" />
<sourceFolder url="file://$MODULE_DIR$/build/source/rs/test" isTestSource="true" />
<sourceFolder url="file://$MODULE_DIR$/build/source/buildConfig/test" isTestSource="true" />
<sourceFolder url="file://$MODULE_DIR$/build/res/rs/test" isTestSource="true" />
<sourceFolder url="file://$MODULE_DIR$/src/debug/aidl" isTestSource="false" />
<sourceFolder url="file://$MODULE_DIR$/src/debug/assets" isTestSource="false" />
<sourceFolder url="file://$MODULE_DIR$/src/debug/java" isTestSource="false" />
<sourceFolder url="file://$MODULE_DIR$/src/debug/jni" isTestSource="false" />
<sourceFolder url="file://$MODULE_DIR$/src/debug/rs" isTestSource="false" />
<sourceFolder url="file://$MODULE_DIR$/src/debug/res" isTestSource="false" />
<sourceFolder url="file://$MODULE_DIR$/src/debug/resources" isTestSource="false" />
<sourceFolder url="file://$MODULE_DIR$/src/main/aidl" isTestSource="false" />
<sourceFolder url="file://$MODULE_DIR$/src/main/assets" isTestSource="false" />
<sourceFolder url="file://$MODULE_DIR$/src/main/java" isTestSource="false" />
<sourceFolder url="file://$MODULE_DIR$/src/main/jni" isTestSource="false" />
<sourceFolder url="file://$MODULE_DIR$/src/main/rs" isTestSource="false" />
<sourceFolder url="file://$MODULE_DIR$/src/main/res" isTestSource="false" />
<sourceFolder url="file://$MODULE_DIR$/src/main/resources" isTestSource="false" />
<sourceFolder url="file://$MODULE_DIR$/src/instrumentTest/aidl" isTestSource="true" />
<sourceFolder url="file://$MODULE_DIR$/src/instrumentTest/assets" isTestSource="true" />
<sourceFolder url="file://$MODULE_DIR$/src/instrumentTest/java" isTestSource="true" />
<sourceFolder url="file://$MODULE_DIR$/src/instrumentTest/jni" isTestSource="true" />
<sourceFolder url="file://$MODULE_DIR$/src/instrumentTest/rs" isTestSource="true" />
<sourceFolder url="file://$MODULE_DIR$/src/instrumentTest/res" isTestSource="true" />
<sourceFolder url="file://$MODULE_DIR$/src/instrumentTest/resources" isTestSource="true" />
<excludeFolder url="file://$MODULE_DIR$/.git" />
<excludeFolder url="file://$MODULE_DIR$/.gradle" />
<excludeFolder url="file://$MODULE_DIR$/build" />
<excludeFolder url="file://$MODULE_DIR$/.idea" />
<excludeFolder url="file://$MODULE_DIR$/build/apk" />
<excludeFolder url="file://$MODULE_DIR$/build/assets" />
<excludeFolder url="file://$MODULE_DIR$/build/bundles" />
<excludeFolder url="file://$MODULE_DIR$/build/classes" />
<excludeFolder url="file://$MODULE_DIR$/build/dependency-cache" />
<excludeFolder url="file://$MODULE_DIR$/build/incremental" />
<excludeFolder url="file://$MODULE_DIR$/build/libs" />
<excludeFolder url="file://$MODULE_DIR$/build/manifests" />
<excludeFolder url="file://$MODULE_DIR$/build/symbols" />
<excludeFolder url="file://$MODULE_DIR$/build/tmp" />
</content>
<orderEntry type="inheritedJdk" />
<orderEntry type="jdk" jdkName="Android API 19 Platform" jdkType="Android SDK" />
<orderEntry type="sourceFolder" forTests="false" />
<orderEntry type="library" exported="" name="slf4j-api-1.6.6" level="project" />
<orderEntry type="library" exported="" name="support-v4-19.0.0" level="project" />
<orderEntry type="library" exported="" name="mina-core-2.0.7" level="project" />
<orderEntry type="library" exported="" name="ComAndroidSupportAppcompatV71900.aar" level="project" />
</component>
</module>

View File

@@ -1 +0,0 @@
include ':KdeConnect'

View File

@@ -1,8 +1,8 @@
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="org.kde.kdeconnect_tp"
android:versionCode="4"
android:versionName="0.2.1">
android:versionCode="9"
android:versionName="0.4">
<uses-sdk android:minSdkVersion="9"
android:targetSdkVersion="18" />
@@ -18,12 +18,12 @@
<uses-feature android:name="android.hardware.telephony" android:required="false" />
<uses-permission android:name="android.permission.RECEIVE_BOOT_COMPLETED" />
<uses-permission android:name="android.permission.INTERNET"/>
<uses-permission android:name="android.permission.ACCESS_NETWORK_STATE"/>
<uses-permission android:name="android.permission.CHANGE_WIFI_MULTICAST_STATE"/>
<uses-permission android:name="android.permission.READ_PHONE_STATE" android:required="false"/>
<uses-permission android:name="android.permission.INTERNET" />
<uses-permission android:name="android.permission.ACCESS_NETWORK_STATE" />
<uses-permission android:name="android.permission.CHANGE_WIFI_MULTICAST_STATE" />
<uses-permission android:name="android.permission.READ_PHONE_STATE" android:required="false" />
<uses-permission android:name="android.permission.BATTERY_STATS" />
<uses-permission android:name="android.permission.RECEIVE_SMS" android:required="false"/>
<uses-permission android:name="android.permission.RECEIVE_SMS" android:required="false" />
<uses-permission android:name="android.permission.READ_CONTACTS" />
<application
@@ -32,6 +32,11 @@
android:label="KDE Connect"
>
<service
android:enabled="true"
android:name="org.kde.kdeconnect.BackgroundService">
</service>
<activity
android:theme="@style/Theme.AppCompat"
android:name="org.kde.kdeconnect.UserInterface.MainActivity"
@@ -39,66 +44,48 @@
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
</activity>
<activity
android:name="org.kde.kdeconnect.UserInterface.MainSettingsActivity"
android:label="@string/settings"
android:parentActivityName="org.kde.kdeconnect.UserInterface.MainActivity"
>
<meta-data android:name="android.support.PARENT_ACTIVITY"
android:value="org.kde.kdeconnect.UserInterface.MainActivity" />
</activity>
<activity
android:theme="@style/Theme.AppCompat"
android:name="org.kde.kdeconnect.UserInterface.DeviceActivity"
android:label="@string/device"
android:parentActivityName="org.kde.connect.UserInterface.MainActivity"
android:parentActivityName="org.kde.kdeconnect.UserInterface.MainActivity"
>
<meta-data android:name="android.support.PARENT_ACTIVITY"
android:value="org.kde.connect.UserInterface.MainActivity" />
</activity>
android:value="org.kde.kdeconnect.UserInterface.MainActivity" />
</activity>
<activity
android:theme="@style/Theme.AppCompat"
android:name="org.kde.kdeconnect.UserInterface.PairActivity"
android:label="@string/pair_device"
android:parentActivityName="org.kde.connect.UserInterface.MainActivity"
android:parentActivityName="org.kde.kdeconnect.UserInterface.MainActivity"
>
<meta-data android:name="android.support.PARENT_ACTIVITY"
android:value="org.kde.connect.UserInterface.MainActivity" />
</activity>
<activity
android:theme="@style/Theme.AppCompat"
android:name="org.kde.kdeconnect.Plugins.MprisPlugin.MprisActivity"
android:label="@string/remote_control"
>
<meta-data android:name="android.support.PARENT_ACTIVITY"
android:value=".DeviceActivity" />
android:value="org.kde.kdeconnect.UserInterface.MainActivity" />
</activity>
<activity
android:name="org.kde.kdeconnect.UserInterface.SettingsActivity"
android:label="@string/settings"
>
android:name="org.kde.kdeconnect.UserInterface.SettingsActivity"
android:label="@string/settings"
android:parentActivityName="org.kde.kdeconnect.UserInterface.DeviceActivity"
>
<meta-data android:name="android.support.PARENT_ACTIVITY"
android:value=".DeviceActivity" />
android:value="org.kde.kdeconnect.UserInterface.DeviceActivity" />
</activity>
<service
android:enabled="true"
android:name="org.kde.kdeconnect.BackgroundService">
</service>
<service android:name="org.kde.kdeconnect.Plugins.NotificationsPlugin.NotificationReceiver"
android:permission="android.permission.BIND_NOTIFICATION_LISTENER_SERVICE">
<intent-filter>
<action android:name="android.service.notification.NotificationListenerService" />
</intent-filter>
</service>
<receiver android:name="org.kde.kdeconnect.KdeConnectBroadcastReceiver">
<intent-filter>
<action android:name="android.intent.action.PACKAGE_REPLACED" />
@@ -124,6 +111,43 @@
</intent-filter>-->
</receiver>
<!-- Plugin-related activities and services -->
<activity
android:theme="@style/Theme.AppCompat"
android:name="org.kde.kdeconnect.Plugins.MprisPlugin.MprisActivity"
android:label="@string/remote_control"
android:parentActivityName="org.kde.kdeconnect.UserInterface.DeviceActivity"
>
<meta-data android:name="android.support.PARENT_ACTIVITY"
android:value="org.kde.kdeconnect.UserInterface.DeviceActivity" />
</activity>
<activity
android:theme="@style/Theme.AppCompat"
android:name="org.kde.kdeconnect.UserInterface.ShareToReceiver"
android:label="KDE Connect"
>
<intent-filter>
<action android:name="android.intent.action.SEND" />
<category android:name="android.intent.category.DEFAULT" />
<data android:mimeType="*/*" />
</intent-filter>
<intent-filter>
<action android:name="android.intent.action.SEND_MULTIPLE" />
<category android:name="android.intent.category.DEFAULT" />
<data android:mimeType="*/*" />
</intent-filter>
</activity>
<service android:name="org.kde.kdeconnect.Plugins.NotificationsPlugin.NotificationReceiver"
android:permission="android.permission.BIND_NOTIFICATION_LISTENER_SERVICE">
<intent-filter>
<action android:name="android.service.notification.NotificationListenerService" />
</intent-filter>
</service>
</application>
</manifest>

View File

@@ -1,18 +1,26 @@
package org.kde.kdeconnect.ComputerLinks;
package org.kde.kdeconnect.Backends;
import android.content.SharedPreferences;
import android.preference.PreferenceManager;
import android.util.Base64;
import org.kde.kdeconnect.LinkProviders.BaseLinkProvider;
import org.kde.kdeconnect.NetworkPackage;
import java.security.KeyFactory;
import java.security.PrivateKey;
import java.security.PublicKey;
import java.security.spec.PKCS8EncodedKeySpec;
import java.util.ArrayList;
public abstract class BaseComputerLink {
public abstract class BaseLink {
private BaseLinkProvider linkProvider;
private String deviceId;
private ArrayList<PackageReceiver> receivers = new ArrayList<PackageReceiver>();
protected PrivateKey privateKey;
protected BaseComputerLink(String deviceId, BaseLinkProvider linkProvider) {
protected BaseLink(String deviceId, BaseLinkProvider linkProvider) {
this.linkProvider = linkProvider;
this.deviceId = deviceId;
}
@@ -21,6 +29,10 @@ public abstract class BaseComputerLink {
return deviceId;
}
public void setPrivateKey(PrivateKey key) {
privateKey = key;
}
public BaseLinkProvider getLinkProvider() {
return linkProvider;
}
@@ -44,7 +56,8 @@ public abstract class BaseComputerLink {
}
}
//TO OVERRIDE
//TO OVERRIDE, should be sync
public abstract boolean sendPackage(NetworkPackage np);
public abstract boolean sendPackageEncrypted(NetworkPackage np, PublicKey key);
}

View File

@@ -1,8 +1,8 @@
package org.kde.kdeconnect.LinkProviders;
package org.kde.kdeconnect.Backends;
import android.util.Log;
import org.kde.kdeconnect.ComputerLinks.BaseComputerLink;
import org.kde.kdeconnect.Backends.BaseLink;
import org.kde.kdeconnect.NetworkPackage;
import java.util.ArrayList;
@@ -12,8 +12,8 @@ public abstract class BaseLinkProvider {
private ArrayList<ConnectionReceiver> connectionReceivers = new ArrayList<ConnectionReceiver>();
public interface ConnectionReceiver {
public void onConnectionReceived(NetworkPackage identityPackage, BaseComputerLink link);
public void onConnectionLost(BaseComputerLink link);
public void onConnectionReceived(NetworkPackage identityPackage, BaseLink link);
public void onConnectionLost(BaseLink link);
}
public void addConnectionReceiver(ConnectionReceiver cr) {
@@ -25,13 +25,13 @@ public abstract class BaseLinkProvider {
}
//These two should be called when the provider links to a new computer
protected void connectionAccepted(NetworkPackage identityPackage, BaseComputerLink link) {
protected void connectionAccepted(NetworkPackage identityPackage, BaseLink link) {
Log.i("LinkProvider", "connectionAccepted");
for(ConnectionReceiver cr : connectionReceivers) {
cr.onConnectionReceived(identityPackage, link);
}
}
protected void connectionLost(BaseComputerLink link) {
protected void connectionLost(BaseLink link) {
Log.i("LinkProvider", "connectionLost");
for(ConnectionReceiver cr : connectionReceivers) {
cr.onConnectionLost(link);

View File

@@ -0,0 +1,201 @@
package org.kde.kdeconnect.Backends.LanBackend;
import android.util.Log;
import org.apache.mina.core.future.WriteFuture;
import org.apache.mina.core.session.IoSession;
import org.json.JSONObject;
import org.kde.kdeconnect.Backends.BaseLink;
import org.kde.kdeconnect.Backends.BaseLinkProvider;
import org.kde.kdeconnect.NetworkPackage;
import java.io.InputStream;
import java.io.OutputStream;
import java.net.InetSocketAddress;
import java.net.ServerSocket;
import java.net.Socket;
import java.security.PublicKey;
public class LanLink extends BaseLink {
private IoSession session = null;
public void disconnect() {
if (session == null) return;
//Log.i("LanLink", "Disconnect: "+session.getRemoteAddress().toString());
session.close(true);
}
public LanLink(IoSession session, String deviceId, BaseLinkProvider linkProvider) {
super(deviceId, linkProvider);
this.session = session;
}
private Thread sendPayload(NetworkPackage np) {
try {
final InputStream stream = np.getPayload();
ServerSocket candidateServer = null;
boolean success = false;
int tcpPort = 1739;
while(!success) {
try {
candidateServer = new ServerSocket();
candidateServer.bind(new InetSocketAddress(tcpPort));
success = true;
} catch(Exception e) {
Log.e("LanLink", "Exception openning serversocket: "+e);
tcpPort++;
if (tcpPort >= 1764) {
Log.e("LanLink", "No more ports available");
return null;
}
}
}
JSONObject payloadTransferInfo = new JSONObject();
payloadTransferInfo.put("port", tcpPort);
final ServerSocket server = candidateServer;
Thread thread = new Thread(new Runnable() {
@Override
public void run() {
//TODO: Timeout when waiting for a connection and close the socket
OutputStream socket = null;
try {
socket = server.accept().getOutputStream();
byte[] buffer = new byte[4096];
int bytesRead;
Log.e("LanLink","Beginning to send payload");
while ((bytesRead = stream.read(buffer)) != -1) {
//Log.e("ok",""+bytesRead);
socket.write(buffer, 0, bytesRead);
}
Log.e("LanLink","Finished sending payload");
} catch(Exception e) {
e.printStackTrace();
Log.e("LanLink", "Exception with payload upload socket");
} finally {
if (socket != null) {
try { socket.close(); } catch(Exception e) { }
}
try { server.close(); } catch(Exception e) { }
}
}
});
thread.start();
np.setPayloadTransferInfo(payloadTransferInfo);
return thread;
} catch(Exception e) {
e.printStackTrace();
Log.e("LanLink", "Exception with payload upload socket");
return null;
}
}
//Blocking, do not call from main thread
@Override
public boolean sendPackage(final NetworkPackage np) {
if (session == null) {
Log.e("LanLink", "sendPackage failed: not yet connected");
return false;
}
try {
Thread thread = null;
if (np.hasPayload()) {
thread = sendPayload(np);
if (thread == null) return false;
}
WriteFuture future = session.write(np.serialize());
future.awaitUninterruptibly();
if (!future.isWritten()) return false;
if (thread != null) {
thread.join(); //Wait for thread to finish
}
return true;
} catch (Exception e) {
e.printStackTrace();
Log.e("LanLink", "sendPackage exception");
return false;
}
}
//Blocking, do not call from main thread
@Override
public boolean sendPackageEncrypted(NetworkPackage np, PublicKey key) {
if (session == null) {
Log.e("LanLink", "sendPackage failed: not yet connected");
return false;
}
try {
Thread thread = null;
if (np.hasPayload()) {
thread = sendPayload(np);
if (thread == null) return false;
}
np = np.encrypt(key);
WriteFuture future = session.write(np.serialize());
if (!future.await().isWritten()) return false;
if (thread != null) {
thread.join(); //Wait for thread to finish
}
return true;
} catch (Exception e) {
e.printStackTrace();
Log.e("LanLink", "sendPackageEncrypted exception");
return false;
}
}
public void injectNetworkPackage(NetworkPackage np) {
if (np.getType().equals(NetworkPackage.PACKAGE_TYPE_ENCRYPTED)) {
try {
np = np.decrypt(privateKey);
} catch(Exception e) {
e.printStackTrace();
Log.e("onPackageReceived","Exception reading the key needed to decrypt the package");
}
}
if (np.hasPayloadTransferInfo()) {
try {
Socket socket = new Socket();
int tcpPort = np.getPayloadTransferInfo().getInt("port");
InetSocketAddress address = (InetSocketAddress)session.getRemoteAddress();
socket.connect(new InetSocketAddress(address.getAddress(), tcpPort));
np.setPayload(socket.getInputStream(), np.getPayloadSize());
} catch (Exception e) {
e.printStackTrace();
Log.e("LanLink", "Exception connecting to payload remote socket");
}
}
packageReceived(np);
}
}

View File

@@ -1,4 +1,4 @@
package org.kde.kdeconnect.LinkProviders;
package org.kde.kdeconnect.Backends.LanBackend;
import android.content.Context;
import android.os.AsyncTask;
@@ -16,7 +16,7 @@ import org.apache.mina.filter.codec.textline.TextLineCodecFactory;
import org.apache.mina.transport.socket.nio.NioDatagramAcceptor;
import org.apache.mina.transport.socket.nio.NioSocketAcceptor;
import org.apache.mina.transport.socket.nio.NioSocketConnector;
import org.kde.kdeconnect.ComputerLinks.LanComputerLink;
import org.kde.kdeconnect.Backends.BaseLinkProvider;
import org.kde.kdeconnect.NetworkPackage;
import java.net.DatagramPacket;
@@ -31,8 +31,8 @@ public class LanLinkProvider extends BaseLinkProvider {
private final static int port = 1714;
private Context context;
private HashMap<String, LanComputerLink> visibleComputers = new HashMap<String, LanComputerLink>();
private HashMap<Long, LanComputerLink> nioSessions = new HashMap<Long, LanComputerLink>();
private HashMap<String, LanLink> visibleComputers = new HashMap<String, LanLink>();
private HashMap<Long, LanLink> nioSessions = new HashMap<Long, LanLink>();
private NioSocketAcceptor tcpAcceptor = null;
private NioDatagramAcceptor udpAcceptor = null;
@@ -41,7 +41,7 @@ public class LanLinkProvider extends BaseLinkProvider {
@Override
public void sessionClosed(IoSession session) throws Exception {
LanComputerLink brokenLink = nioSessions.remove(session.getId());
LanLink brokenLink = nioSessions.remove(session.getId());
if (brokenLink != null) {
connectionLost(brokenLink);
brokenLink.disconnect();
@@ -62,14 +62,18 @@ public class LanLinkProvider extends BaseLinkProvider {
String theMessage = (String) message;
NetworkPackage np = NetworkPackage.unserialize(theMessage);
LanComputerLink prevLink = nioSessions.get(session.getId());
LanLink prevLink = nioSessions.get(session.getId());
if (np.getType().equals(NetworkPackage.PACKAGE_TYPE_IDENTITY)) {
String myId = NetworkPackage.createIdentityPackage(context).getString("deviceId");
if (np.getString("deviceId").equals(myId)) {
return;
}
LanComputerLink link = new LanComputerLink(session, np.getString("deviceId"), LanLinkProvider.this);
//Log.e("LanLinkProvider", "Identity package received from "+np.getString("deviceName"));
LanLink link = new LanLink(session, np.getString("deviceId"), LanLinkProvider.this);
nioSessions.put(session.getId(),link);
addLink(np, link);
} else {
@@ -90,77 +94,72 @@ public class LanLinkProvider extends BaseLinkProvider {
//Log.e("LanLinkProvider", "Udp message received (" + message.getClass() + ") " + message.toString());
NetworkPackage np = null;
try {
//We should receive a string thanks to the TextLineCodecFactory filter
String theMessage = (String) message;
np = NetworkPackage.unserialize(theMessage);
} catch (Exception e) {
e.printStackTrace();
Log.e("LanLinkProvider", "Could not unserialize package");
}
final NetworkPackage identityPackage = NetworkPackage.unserialize(theMessage);
if (np != null) {
final NetworkPackage identityPackage = np;
if (!np.getType().equals(NetworkPackage.PACKAGE_TYPE_IDENTITY)) {
if (!identityPackage.getType().equals(NetworkPackage.PACKAGE_TYPE_IDENTITY)) {
Log.e("LanLinkProvider", "1 Expecting an identity package");
return;
} else {
String myId = NetworkPackage.createIdentityPackage(context).getString("deviceId");
if (np.getString("deviceId").equals(myId)) {
if (identityPackage.getString("deviceId").equals(myId)) {
return;
}
}
Log.i("LanLinkProvider", "Identity package received, creating link");
try {
final InetSocketAddress address = (InetSocketAddress) udpSession.getRemoteAddress();
final InetSocketAddress address = (InetSocketAddress) udpSession.getRemoteAddress();
final NioSocketConnector connector = new NioSocketConnector();
connector.setHandler(tcpHandler);
//TextLineCodecFactory will split incoming data delimited by the given string
connector.getFilterChain().addLast("codec",
new ProtocolCodecFilter(
new TextLineCodecFactory(Charset.defaultCharset(), LineDelimiter.UNIX, LineDelimiter.UNIX)
)
);
connector.getSessionConfig().setKeepAlive(true);
final NioSocketConnector connector = new NioSocketConnector();
connector.setHandler(tcpHandler);
//TextLineCodecFactory will split incoming data delimited by the given string
connector.getFilterChain().addLast("codec",
new ProtocolCodecFilter(
new TextLineCodecFactory(Charset.defaultCharset(), LineDelimiter.UNIX, LineDelimiter.UNIX)
)
);
connector.getSessionConfig().setKeepAlive(true);
int tcpPort = np.getInt("tcpPort",port);
ConnectFuture future = connector.connect(new InetSocketAddress(address.getAddress(), tcpPort));
future.addListener(new IoFutureListener<IoFuture>() {
@Override
public void operationComplete(IoFuture ioFuture) {
IoSession session = ioFuture.getSession();
int tcpPort = identityPackage.getInt("tcpPort",port);
ConnectFuture future = connector.connect(new InetSocketAddress(address.getAddress(), tcpPort));
future.addListener(new IoFutureListener<IoFuture>() {
@Override
public void operationComplete(IoFuture ioFuture) {
final IoSession session = ioFuture.getSession();
Log.i("LanLinkProvider", "Connection successful: " + session.isConnected());
final LanLink link = new LanLink(session, identityPackage.getString("deviceId"), LanLinkProvider.this);
LanComputerLink link = new LanComputerLink(session, identityPackage.getString("deviceId"), LanLinkProvider.this);
Log.i("LanLinkProvider", "Connection successful: " + session.isConnected());
NetworkPackage np2 = NetworkPackage.createIdentityPackage(context);
link.sendPackage(np2);
new Thread(new Runnable() {
@Override
public void run() {
NetworkPackage np2 = NetworkPackage.createIdentityPackage(context);
link.sendPackage(np2);
nioSessions.put(session.getId(), link);
addLink(identityPackage, link);
}
});
nioSessions.put(session.getId(), link);
addLink(identityPackage, link);
}
}).start();
} catch (Exception e) {
Log.e("LanLinkProvider","Exception!!");
e.printStackTrace();
}
}
});
} catch (Exception e) {
Log.e("LanLinkProvider","Exception receiving udp package!!");
e.printStackTrace();
}
}
};
private void addLink(NetworkPackage identityPackage, LanComputerLink link) {
private void addLink(NetworkPackage identityPackage, LanLink link) {
String deviceId = identityPackage.getString("deviceId");
Log.i("LanLinkProvider","addLink to "+deviceId);
LanComputerLink oldLink = visibleComputers.get(deviceId);
LanLink oldLink = visibleComputers.get(deviceId);
visibleComputers.put(deviceId, link);
connectionAccepted(identityPackage, link);
if (oldLink != null) {

View File

@@ -0,0 +1,43 @@
package org.kde.kdeconnect.Backends.LoopbackBackend;
import android.util.Log;
import org.kde.kdeconnect.Backends.BaseLink;
import org.kde.kdeconnect.Backends.BaseLinkProvider;
import org.kde.kdeconnect.NetworkPackage;
import java.security.PublicKey;
public class LoopbackLink extends BaseLink {
public LoopbackLink(BaseLinkProvider linkProvider) {
super("loopback", linkProvider);
}
@Override
public boolean sendPackage(NetworkPackage in) {
String s = in.serialize();
NetworkPackage out= NetworkPackage.unserialize(s);
if (in.hasPayload()) out.setPayload(in.getPayload(), in.getPayloadSize());
packageReceived(out);
return true;
}
@Override
public boolean sendPackageEncrypted(NetworkPackage in, PublicKey key) {
try {
in = in.encrypt(key);
String s = in.serialize();
NetworkPackage out= NetworkPackage.unserialize(s);
out.decrypt(privateKey);
packageReceived(out);
if (in.hasPayload()) out.setPayload(in.getPayload(), in.getPayloadSize());
return true;
} catch(Exception e) {
e.printStackTrace();
Log.e("LoopbackLink", "Encryption exception");
return false;
}
}
}

View File

@@ -0,0 +1,43 @@
package org.kde.kdeconnect.Backends.LoopbackBackend;
import android.content.Context;
import org.kde.kdeconnect.Backends.BaseLinkProvider;
import org.kde.kdeconnect.NetworkPackage;
public class LoopbackLinkProvider extends BaseLinkProvider {
private Context context;
public LoopbackLinkProvider(Context context) {
this.context = context;
}
@Override
public void onStart() {
onNetworkChange();
}
@Override
public void onStop() {
}
@Override
public void onNetworkChange() {
NetworkPackage np = NetworkPackage.createIdentityPackage(context);
connectionAccepted(np, new LoopbackLink(this));
}
@Override
public int getPriority() {
return 0;
}
@Override
public String getName() {
return "LoopbackLinkProvider";
}
}

View File

@@ -11,10 +11,10 @@ import android.preference.PreferenceManager;
import android.util.Base64;
import android.util.Log;
import org.kde.kdeconnect.ComputerLinks.BaseComputerLink;
import org.kde.kdeconnect.LinkProviders.BaseLinkProvider;
import org.kde.kdeconnect.LinkProviders.LanLinkProvider;
import org.kde.kdeconnect.LinkProviders.LoopbackLinkProvider;
import org.kde.kdeconnect.Backends.BaseLink;
import org.kde.kdeconnect.Backends.BaseLinkProvider;
import org.kde.kdeconnect.Backends.LanBackend.LanLinkProvider;
import org.kde.kdeconnect.UserInterface.MainSettingsActivity;
import java.security.KeyPair;
import java.security.KeyPairGenerator;
@@ -54,7 +54,7 @@ public class BackgroundService extends Service {
Set<String> trustedDevices = preferences.getAll().keySet();
for(String deviceId : trustedDevices) {
if (preferences.getBoolean(deviceId, false)) {
Device device = new Device(getBaseContext(), deviceId);
Device device = new Device(this, deviceId);
devices.put(deviceId,device);
device.addPairingCallback(devicePairingCallback);
}
@@ -81,7 +81,7 @@ public class BackgroundService extends Service {
private BaseLinkProvider.ConnectionReceiver deviceListener = new BaseLinkProvider.ConnectionReceiver() {
@Override
public void onConnectionReceived(final NetworkPackage identityPackage, final BaseComputerLink link) {
public void onConnectionReceived(final NetworkPackage identityPackage, final BaseLink link) {
Log.i("BackgroundService", "Connection accepted!");
@@ -91,11 +91,11 @@ public class BackgroundService extends Service {
if (device != null) {
Log.i("BackgroundService", "addLink, known device: " + deviceId);
device.addLink(link);
device.addLink(identityPackage, link);
} else {
Log.i("BackgroundService", "addLink,unknown device: " + deviceId);
String name = identityPackage.getString("deviceName");
device = new Device(getBaseContext(), deviceId, name, link);
device = new Device(BackgroundService.this, identityPackage, link);
devices.put(deviceId, device);
device.addPairingCallback(devicePairingCallback);
}
@@ -104,7 +104,7 @@ public class BackgroundService extends Service {
}
@Override
public void onConnectionLost(BaseComputerLink link) {
public void onConnectionLost(BaseLink link) {
Device d = devices.get(link.getDeviceId());
Log.i("onConnectionLost", "removeLink, deviceId: " + link.getDeviceId());
if (d != null) {
@@ -179,6 +179,7 @@ public class BackgroundService extends Service {
Log.i("BackgroundService","Service not started yet, initializing...");
initializeRsaKeys();
MainSettingsActivity.initializeDeviceName(this);
loadRememberedDevicesFromSettings();
registerLinkProviders();

View File

@@ -7,7 +7,6 @@ import android.content.Context;
import android.content.Intent;
import android.content.SharedPreferences;
import android.content.res.Resources;
import android.os.AsyncTask;
import android.os.Handler;
import android.os.Looper;
import android.preference.PreferenceManager;
@@ -15,7 +14,7 @@ import android.support.v4.app.NotificationCompat;
import android.util.Base64;
import android.util.Log;
import org.kde.kdeconnect.ComputerLinks.BaseComputerLink;
import org.kde.kdeconnect.Backends.BaseLink;
import org.kde.kdeconnect.Plugins.Plugin;
import org.kde.kdeconnect.Plugins.PluginFactory;
import org.kde.kdeconnect.UserInterface.PairActivity;
@@ -34,7 +33,7 @@ import java.util.Set;
import java.util.Timer;
import java.util.TimerTask;
public class Device implements BaseComputerLink.PackageReceiver {
public class Device implements BaseLink.PackageReceiver {
private Context context;
@@ -42,6 +41,7 @@ public class Device implements BaseComputerLink.PackageReceiver {
private String name;
private PublicKey publicKey;
private int notificationId;
private int protocolVersion;
private enum PairStatus {
NotPaired,
@@ -61,7 +61,7 @@ public class Device implements BaseComputerLink.PackageReceiver {
private ArrayList<PairingCallback> pairingCallback = new ArrayList<PairingCallback>();
private Timer pairingTimer;
private ArrayList<BaseComputerLink> links = new ArrayList<BaseComputerLink>();
private ArrayList<BaseLink> links = new ArrayList<BaseLink>();
private HashMap<String, Plugin> plugins = new HashMap<String, Plugin>();
private HashMap<String, Plugin> failedPlugins = new HashMap<String, Plugin>();
@@ -77,6 +77,7 @@ public class Device implements BaseComputerLink.PackageReceiver {
this.deviceId = deviceId;
this.name = settings.getString("deviceName", "unknown device");
this.pairStatus = PairStatus.Paired;
this.protocolVersion = NetworkPackage.ProtocolVersion; //We don't know it yet
try {
byte[] publicKeyBytes = Base64.decode(settings.getString("publicKey", ""), 0);
@@ -90,18 +91,20 @@ public class Device implements BaseComputerLink.PackageReceiver {
}
//Device known via an incoming connection sent to us via a devicelink, we know everything but we don't trust it yet
Device(Context context, String deviceId, String name, BaseComputerLink dl) {
settings = context.getSharedPreferences(deviceId, Context.MODE_PRIVATE);
Device(Context context, NetworkPackage np, BaseLink dl) {
//Log.e("Device","Constructor B");
this.context = context;
this.deviceId = deviceId;
this.name = name;
this.deviceId = np.getString("deviceId");
this.name = np.getString("deviceName", "unidentified device");
this.protocolVersion = np.getInt("protocolVersion");
this.pairStatus = PairStatus.NotPaired;
this.publicKey = null;
addLink(dl);
settings = context.getSharedPreferences(deviceId, Context.MODE_PRIVATE);
addLink(np, dl);
}
public String getName() {
@@ -112,6 +115,10 @@ public class Device implements BaseComputerLink.PackageReceiver {
return deviceId;
}
//Returns 0 if the version matches, < 0 if it is older or > 0 if it is newer
public int compareProtocolVersion() {
return protocolVersion - NetworkPackage.ProtocolVersion;
}
@@ -144,37 +151,52 @@ public class Device implements BaseComputerLink.PackageReceiver {
Resources res = context.getResources();
if (pairStatus == PairStatus.Paired) {
for (PairingCallback cb : pairingCallback) cb.pairingFailed(res.getString(R.string.error_already_paired));
for (PairingCallback cb : pairingCallback) {
cb.pairingFailed(res.getString(R.string.error_already_paired));
}
return;
}
if (pairStatus == PairStatus.Requested) {
for (PairingCallback cb : pairingCallback) cb.pairingFailed(res.getString(R.string.error_already_requested));
for (PairingCallback cb : pairingCallback) {
cb.pairingFailed(res.getString(R.string.error_already_requested));
}
return;
}
if (!isReachable()) {
for (PairingCallback cb : pairingCallback) cb.pairingFailed(res.getString(R.string.error_not_reachable));
for (PairingCallback cb : pairingCallback) {
cb.pairingFailed(res.getString(R.string.error_not_reachable));
}
return;
}
//Send our own public key
NetworkPackage np = NetworkPackage.createPublicKeyPackage(context);
boolean success = sendPackage(np);
sendPackage(np, new SendPackageFinishedCallback(){
if (!success) {
for (PairingCallback cb : pairingCallback) cb.pairingFailed(res.getString(R.string.error_could_not_send_package));
return;
}
pairingTimer = new Timer();
pairingTimer.schedule(new TimerTask() {
@Override
public void run() {
for (PairingCallback cb : pairingCallback) cb.pairingFailed(context.getString(R.string.error_timed_out));
public void sendSuccessful() {
pairingTimer = new Timer();
pairingTimer.schedule(new TimerTask() {
@Override
public void run() {
for (PairingCallback cb : pairingCallback) {
cb.pairingFailed(context.getString(R.string.error_timed_out));
}
pairStatus = PairStatus.NotPaired;
}
}, 30*1000);
pairStatus = PairStatus.Requested;
}
@Override
public void sendFailed() {
for (PairingCallback cb : pairingCallback) {
cb.pairingFailed(context.getString(R.string.error_could_not_send_package));
}
pairStatus = PairStatus.NotPaired;
}
}, 20*1000);
pairStatus = PairStatus.Requested;
});
}
@@ -201,15 +223,7 @@ public class Device implements BaseComputerLink.PackageReceiver {
}
public void acceptPairing() {
Log.i("Device","Accepted pairing");
//Send our own public key
NetworkPackage np = NetworkPackage.createPublicKeyPackage(context);
boolean success = sendPackage(np);
if (!success) return;
private void pairingDone() {
pairStatus = PairStatus.Paired;
@@ -226,13 +240,37 @@ public class Device implements BaseComputerLink.PackageReceiver {
reloadPluginsFromSettings();
for (PairingCallback cb : pairingCallback) cb.pairingSuccessful();
for (PairingCallback cb : pairingCallback) {
cb.pairingSuccessful();
}
}
public void acceptPairing() {
Log.i("Device","Accepted pair request started by the other device");
//Send our own public key
NetworkPackage np = NetworkPackage.createPublicKeyPackage(context);
sendPackage(np, new SendPackageFinishedCallback() {
@Override
public void sendSuccessful() {
pairingDone();
}
@Override
public void sendFailed() {
pairStatus = PairStatus.NotPaired;
for (PairingCallback cb : pairingCallback) {
cb.pairingFailed(context.getString(R.string.error_not_reachable));
}
}
});
}
public void rejectPairing() {
Log.i("Device","Rejected pairing");
Log.i("Device","Rejected pair request started by the other device");
pairStatus = PairStatus.NotPaired;
@@ -240,7 +278,9 @@ public class Device implements BaseComputerLink.PackageReceiver {
np.set("pair", false);
sendPackage(np);
for (PairingCallback cb : pairingCallback) cb.pairingFailed(context.getString(R.string.error_canceled_by_user));
for (PairingCallback cb : pairingCallback) {
cb.pairingFailed(context.getString(R.string.error_canceled_by_user));
}
}
@@ -255,15 +295,27 @@ public class Device implements BaseComputerLink.PackageReceiver {
return !links.isEmpty();
}
public void addLink(BaseComputerLink link) {
public void addLink(NetworkPackage identityPackage, BaseLink link) {
this.protocolVersion = identityPackage.getInt("protocolVersion");
links.add(link);
try {
SharedPreferences globalSettings = PreferenceManager.getDefaultSharedPreferences(context);
byte[] privateKeyBytes = Base64.decode(globalSettings.getString("privateKey", ""), 0);
PrivateKey privateKey = KeyFactory.getInstance("RSA").generatePrivate(new PKCS8EncodedKeySpec(privateKeyBytes));
link.setPrivateKey(privateKey);
} catch (Exception e) {
e.printStackTrace();
Log.e("Device", "Exception reading our own private key"); //Should not happen
}
Log.i("Device","addLink "+link.getLinkProvider().getName()+" -> "+getName() + " active links: "+ links.size());
Collections.sort(links, new Comparator<BaseComputerLink>() {
Collections.sort(links, new Comparator<BaseLink>() {
@Override
public int compare(BaseComputerLink o, BaseComputerLink o2) {
public int compare(BaseLink o, BaseLink o2) {
return o2.getLinkProvider().getPriority() - o.getLinkProvider().getPriority();
}
});
@@ -275,7 +327,7 @@ public class Device implements BaseComputerLink.PackageReceiver {
}
}
public void removeLink(BaseComputerLink link) {
public void removeLink(BaseLink link) {
link.removePackageReceiver(this);
links.remove(link);
Log.i("Device","removeLink: "+link.getLinkProvider().getName() + " -> "+getName() + " active links: "+ links.size());
@@ -297,7 +349,9 @@ public class Device implements BaseComputerLink.PackageReceiver {
if (pairStatus == PairStatus.Requested) {
pairStatus = PairStatus.NotPaired;
pairingTimer.cancel();
for (PairingCallback cb : pairingCallback) cb.pairingFailed(context.getString(R.string.error_canceled_by_other_peer));
for (PairingCallback cb : pairingCallback) {
cb.pairingFailed(context.getString(R.string.error_canceled_by_other_peer));
}
}
return;
}
@@ -312,7 +366,9 @@ public class Device implements BaseComputerLink.PackageReceiver {
} catch(Exception e) {
e.printStackTrace();
Log.e("Device","Pairing exception: Received incorrect key");
for (PairingCallback cb : pairingCallback) cb.pairingFailed(context.getString(R.string.error_invalid_key));
for (PairingCallback cb : pairingCallback) {
cb.pairingFailed(context.getString(R.string.error_invalid_key));
}
return;
}
@@ -320,23 +376,9 @@ public class Device implements BaseComputerLink.PackageReceiver {
Log.i("Pairing","Pair answer");
pairStatus = PairStatus.Paired;
pairingTimer.cancel();
//Store as trusted device
String encodedPublicKey = Base64.encodeToString(publicKey.getEncoded(), 0);
SharedPreferences preferences = context.getSharedPreferences("trusted_devices", Context.MODE_PRIVATE);
preferences.edit().putBoolean(deviceId,true).commit();
//Store device information needed to create a Device object in a future
SharedPreferences.Editor editor = settings.edit();
editor.putString("deviceName", getName());
editor.putString("publicKey", encodedPublicKey);
editor.commit();
reloadPluginsFromSettings();
for (PairingCallback cb : pairingCallback) cb.pairingSuccessful();
pairingDone();
} else {
@@ -370,7 +412,7 @@ public class Device implements BaseComputerLink.PackageReceiver {
pairStatus = PairStatus.NotPaired;
notificationManager.cancel(notificationId);
}
}, 19*1000); //Time to show notification
}, 25*1000); //Time to show notification
pairStatus = PairStatus.RequestedByPeer;
for (PairingCallback cb : pairingCallback) cb.incomingRequest();
@@ -381,7 +423,9 @@ public class Device implements BaseComputerLink.PackageReceiver {
if (pairStatus == PairStatus.Requested) {
pairingTimer.cancel();
for (PairingCallback cb : pairingCallback) cb.pairingFailed(context.getString(R.string.error_canceled_by_other_peer));
for (PairingCallback cb : pairingCallback) {
cb.pairingFailed(context.getString(R.string.error_canceled_by_other_peer));
}
} else if (pairStatus == PairStatus.Paired) {
SharedPreferences preferences = context.getSharedPreferences("trusted_devices", Context.MODE_PRIVATE);
preferences.edit().remove(deviceId).commit();
@@ -398,23 +442,6 @@ public class Device implements BaseComputerLink.PackageReceiver {
Log.e("onPackageReceived","Device not paired, ignoring package!");
} else {
if (np.getType().equals(NetworkPackage.PACKAGE_TYPE_ENCRYPTED)) {
try {
//TODO: Do not read the key every time
SharedPreferences globalSettings = PreferenceManager.getDefaultSharedPreferences(context);
byte[] privateKeyBytes = Base64.decode(globalSettings.getString("privateKey",""), 0);
PrivateKey privateKey = KeyFactory.getInstance("RSA").generatePrivate(new PKCS8EncodedKeySpec(privateKeyBytes));
np = np.decrypt(privateKey);
} catch(Exception e) {
e.printStackTrace();
Log.e("onPackageReceived","Exception reading the key needed to decrypt the package");
}
} else {
//TODO: The other side doesn't know that we are already paired, do something
Log.e("onPackageReceived","WARNING: Received unencrypted package from paired device!");
}
for (Plugin plugin : plugins.values()) {
plugin.onPackageReceived(np);
@@ -423,36 +450,57 @@ public class Device implements BaseComputerLink.PackageReceiver {
}
public interface SendPackageFinishedCallback {
void sendSuccessful();
void sendFailed();
}
public boolean sendPackage(final NetworkPackage np) {
public void sendPackage(NetworkPackage np) {
sendPackage(np,null);
}
if (!np.getType().equals(NetworkPackage.PACKAGE_TYPE_PAIR) && isPaired()) {
try {
np.encrypt(publicKey);
} catch(Exception e) {
e.printStackTrace();
Log.e("Device","sendPackage exception - could not encrypt");
}
}
//Async
public void sendPackage(final NetworkPackage np, final SendPackageFinishedCallback callback) {
new AsyncTask<Void,Void,Void>() {
final Exception backtrace = new Exception();
new Thread(new Runnable() {
@Override
protected Void doInBackground(Void... voids) {
for(BaseComputerLink link : links) {
//Log.e("sendPackage","Trying "+link.getLinkProvider().getName());
if (link.sendPackage(np)) {
//Log.e("sent using", link.getLinkProvider().getName());
return null;
public void run() {
//Log.e("sendPackage", "Sending package...");
//Log.e("sendPackage", np.serialize());
boolean useEncryption = (!np.getType().equals(NetworkPackage.PACKAGE_TYPE_PAIR) && isPaired());
//We need a copy to avoid concurrent modification exception if the original list changes
ArrayList<BaseLink> mLinks = new ArrayList<BaseLink>(links);
boolean success = false;
for(BaseLink link : mLinks) {
if (useEncryption) {
success = link.sendPackageEncrypted(np, publicKey);
} else {
success = link.sendPackage(np);
}
if (success) break;
}
Log.e("sendPackage","Error: Package could not be sent ("+links.size()+" links available)");
return null;
if (success) {
// Log.e("sendPackage","Package sent");
} else {
backtrace.printStackTrace();
Log.e("sendPackage","Error: Package could not be sent ("+mLinks.size()+" links available)");
}
if (callback != null) {
if (success) callback.sendSuccessful();
else callback.sendFailed();
}
}
}.execute();
}).start();
//TODO: Detect when unable to send a package and try again somehow
return !links.isEmpty();
}

View File

@@ -35,10 +35,13 @@ public class ContactsHelper {
if (nameIndex != -1) {
String name = cursor.getString(nameIndex);
//Log.e("PhoneNumberLookup", "success: " + name);
cursor.close();
return name;
}
}
if (cursor != null) cursor.close();
return number;
}

View File

@@ -154,7 +154,7 @@ public class HumanDeviceNames {
humanReadableNames.put("XT907","Motorola Droid Razr M");
}
static String getDeviceName() {
public static String getDeviceName() {
String dictName = humanReadableNames.get(Build.MODEL.replace(' ','_'));
if (dictName != null) return dictName;

View File

@@ -10,7 +10,13 @@ import android.util.Log;
import org.json.JSONArray;
import org.json.JSONException;
import org.json.JSONObject;
import org.kde.kdeconnect.UserInterface.MainSettingsActivity;
import org.kde.kdeconnect_tp.R;
import java.io.ByteArrayInputStream;
import java.io.IOException;
import java.io.InputStream;
import java.io.OutputStream;
import java.nio.charset.Charset;
import java.security.PrivateKey;
import java.security.PublicKey;
@@ -20,7 +26,7 @@ import javax.crypto.Cipher;
public class NetworkPackage {
public final static int ProtocolVersion = 3;
public final static int ProtocolVersion = 5;
public final static String PACKAGE_TYPE_IDENTITY = "kdeconnect.identity";
public final static String PACKAGE_TYPE_PAIR = "kdeconnect.pair";
@@ -31,18 +37,26 @@ public class NetworkPackage {
public final static String PACKAGE_TYPE_NOTIFICATION = "kdeconnect.notification";
public final static String PACKAGE_TYPE_CLIPBOARD = "kdeconnect.clipboard";
public final static String PACKAGE_TYPE_MPRIS = "kdeconnect.mpris";
public final static String PACKAGE_TYPE_SHARE = "kdeconnect.share";
private long mId;
private String mType;
private JSONObject mBody;
private InputStream mPayload;
private JSONObject mPayloadTransferInfo;
private int mPayloadSize;
private NetworkPackage() {
}
public NetworkPackage(String type) {
mId = System.currentTimeMillis();
mType = type;
mBody = new JSONObject();
mPayload = null;
mPayloadSize = 0;
mPayloadTransferInfo = new JSONObject();
}
public String getType() {
@@ -62,6 +76,9 @@ public class NetworkPackage {
public double getDouble(String key) { return mBody.optDouble(key,Double.NaN); }
public double getDouble(String key, double defaultValue) { return mBody.optDouble(key,defaultValue); }
public void set(String key, double value) { try { mBody.put(key,value); } catch(Exception e) { } }
public JSONArray getJSONArray(String key) { return mBody.optJSONArray(key); }
public void set(String key, JSONArray value) { try { mBody.put(key,value); } catch(Exception e) { } }
public ArrayList<String> getStringList(String key) {
JSONArray jsonArray = mBody.optJSONArray(key);
ArrayList<String> list = new ArrayList<String>();
@@ -91,40 +108,64 @@ public class NetworkPackage {
}
}
public boolean has(String key) { return mBody.has(key); }
public boolean isEncrypted() { return mType.equals(PACKAGE_TYPE_ENCRYPTED); }
public String serialize() {
JSONObject jo = new JSONObject();
try {
jo.put("id",mId);
jo.put("type",mType);
jo.put("body",mBody);
jo.put("id", mId);
jo.put("type", mType);
jo.put("body", mBody);
if (hasPayload()) {
jo.put("payloadSize", mPayloadSize);
jo.put("payloadTransferInfo", mPayloadTransferInfo);
}
} catch(Exception e) {
e.printStackTrace();
Log.e("NetworkPackage", "Serialization exception");
}
//QJSon does not escape slashes, but Java JSONObject does. Converting to QJson format.
String json = jo.toString().replace("\\/","/")+"\n";
//Log.e("NetworkPackage.serialize",json);
if (!isEncrypted()) {
//Log.e("NetworkPackage.serialize", json);
}
return json;
}
static public NetworkPackage unserialize(String s) {
//Log.e("NetworkPackage.unserialize", s);
NetworkPackage np = new NetworkPackage();
try {
JSONObject jo = new JSONObject(s);
np.mId = jo.getLong("id");
np.mType = jo.getString("type");
np.mBody = jo.getJSONObject("body");
if (jo.has("payloadSize")) {
np.mPayloadTransferInfo = jo.getJSONObject("payloadTransferInfo");
np.mPayloadSize = jo.getInt("payloadSize");
} else {
np.mPayloadTransferInfo = new JSONObject();
np.mPayloadSize = 0;
}
} catch (Exception e) {
e.printStackTrace();
Log.e("NetworkPackage", "Unserialization exception unserializing "+s);
return null;
}
if (!np.isEncrypted()) {
//Log.e("NetworkPackage.unserialize", s);
}
return np;
}
public void encrypt(PublicKey publicKey) throws Exception {
public NetworkPackage encrypt(PublicKey publicKey) throws Exception {
String serialized = serialize();
@@ -146,17 +187,11 @@ public class NetworkPackage {
chunks.put(Base64.encodeToString(encryptedChunk, Base64.NO_WRAP));
}
mId = System.currentTimeMillis();
mType = NetworkPackage.PACKAGE_TYPE_ENCRYPTED;
mBody = new JSONObject();
try {
mBody.put("data", chunks);
}catch(Exception e){
e.printStackTrace();
Log.e("NetworkPackage","Exception");
}
//Log.i("NetworkPackage", "Encrypted " + chunks.length()+" chunks");
Log.i("NetworkPackage", "Encrypted " + chunks.length()+" chunks");
NetworkPackage encrypted = new NetworkPackage(NetworkPackage.PACKAGE_TYPE_ENCRYPTED);
encrypted.set("data", chunks);
return encrypted;
}
@@ -177,7 +212,6 @@ public class NetworkPackage {
return unserialize(decryptedJson);
}
static public NetworkPackage createIdentityPackage(Context context) {
NetworkPackage np = new NetworkPackage(NetworkPackage.PACKAGE_TYPE_IDENTITY);
@@ -185,7 +219,10 @@ public class NetworkPackage {
String deviceId = Settings.Secure.getString(context.getContentResolver(), Settings.Secure.ANDROID_ID);
try {
np.mBody.put("deviceId", deviceId);
np.mBody.put("deviceName", HumanDeviceNames.getDeviceName());
np.mBody.put("deviceName",
PreferenceManager.getDefaultSharedPreferences(context).getString(
MainSettingsActivity.KEY_DEVICE_NAME_PREFERENCE,
HumanDeviceNames.getDeviceName()));
np.mBody.put("protocolVersion", NetworkPackage.ProtocolVersion);
} catch (JSONException e) {
}
@@ -208,4 +245,40 @@ public class NetworkPackage {
}
public void setPayload(byte[] data) {
setPayload(new ByteArrayInputStream(data), data.length);
}
public void setPayload(InputStream stream, int size) {
mPayload = stream;
mPayloadSize = size;
}
/*public void setPayload(InputStream stream) {
setPayload(stream, -1);
}*/
public InputStream getPayload() {
return mPayload;
}
public int getPayloadSize() {
return mPayloadSize;
}
public boolean hasPayload() {
return (mPayload != null);
}
public boolean hasPayloadTransferInfo() {
return (mPayloadTransferInfo.length() > 0);
}
public JSONObject getPayloadTransferInfo() {
return mPayloadTransferInfo;
}
public void setPayloadTransferInfo(JSONObject payloadTransferInfo) {
mPayloadTransferInfo = payloadTransferInfo;
}
}

View File

@@ -13,10 +13,10 @@ import android.widget.SeekBar;
import android.widget.Spinner;
import android.widget.TextView;
import org.kde.kdeconnect.Backends.BaseLink;
import org.kde.kdeconnect.BackgroundService;
import org.kde.kdeconnect.ComputerLinks.BaseComputerLink;
import org.kde.kdeconnect.Device;
import org.kde.kdeconnect.LinkProviders.BaseLinkProvider;
import org.kde.kdeconnect.Backends.BaseLinkProvider;
import org.kde.kdeconnect.NetworkPackage;
import org.kde.kdeconnect_tp.R;
@@ -93,8 +93,12 @@ public class MprisActivity extends Activity {
//Spotify doesn't support changing the volume yet...
if (player.equals("Spotify")) {
findViewById(R.id.volume_layout).setVisibility(View.INVISIBLE);
findViewById(R.id.rew_button).setVisibility(View.GONE);
findViewById(R.id.ff_button).setVisibility(View.GONE);
} else {
findViewById(R.id.volume_layout).setVisibility(View.VISIBLE);
findViewById(R.id.rew_button).setVisibility(View.VISIBLE);
findViewById(R.id.ff_button).setVisibility(View.VISIBLE);
}
}
@@ -121,12 +125,12 @@ public class MprisActivity extends Activity {
BaseLinkProvider.ConnectionReceiver connectionReceiver = new BaseLinkProvider.ConnectionReceiver() {
@Override
public void onConnectionReceived(NetworkPackage identityPackage, BaseComputerLink link) {
public void onConnectionReceived(NetworkPackage identityPackage, BaseLink link) {
connectToPlugin();
}
@Override
public void onConnectionLost(BaseComputerLink link) {
public void onConnectionLost(BaseLink link) {
}
};
@@ -187,6 +191,36 @@ public class MprisActivity extends Activity {
}
});
findViewById(R.id.rew_button).setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View view) {
BackgroundService.RunCommand(MprisActivity.this, new BackgroundService.InstanceCallback() {
@Override
public void onServiceStart(BackgroundService service) {
Device device = service.getDevice(deviceId);
MprisPlugin mpris = (MprisPlugin)device.getPlugin("plugin_mpris");
if (mpris == null) return;
mpris.Seek(-10000000); // -10 seconds. TODO: plugin settings UI?
}
});
}
});
findViewById(R.id.ff_button).setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View view) {
BackgroundService.RunCommand(MprisActivity.this, new BackgroundService.InstanceCallback() {
@Override
public void onServiceStart(BackgroundService service) {
Device device = service.getDevice(deviceId);
MprisPlugin mpris = (MprisPlugin)device.getPlugin("plugin_mpris");
if (mpris == null) return;
mpris.Seek(10000000); // 10 seconds. TODO: plugin settings UI?
}
});
}
});
findViewById(R.id.next_button).setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View view) {

View File

@@ -84,6 +84,13 @@ public class MprisPlugin extends Plugin {
device.sendPackage(np);
}
public void Seek(int offset) {
NetworkPackage np = new NetworkPackage(NetworkPackage.PACKAGE_TYPE_MPRIS);
np.set("player",player);
np.set("Seek",offset);
device.sendPackage(np);
}
@Override
public boolean onPackageReceived(NetworkPackage np) {
if (!np.getType().equals(NetworkPackage.PACKAGE_TYPE_MPRIS)) return false;

View File

@@ -172,10 +172,10 @@ public class NotificationsPlugin extends Plugin implements NotificationReceiver.
@Override
public void onNotificationPosted(StatusBarNotification statusBarNotification) {
onNotificationPosted(statusBarNotification, false);
sendNotification(statusBarNotification, false);
}
public void onNotificationPosted(StatusBarNotification statusBarNotification, boolean requestAnswer) {
public void sendNotification(StatusBarNotification statusBarNotification, boolean requestAnswer) {
Notification notification = statusBarNotification.getNotification();
NotificationId id = NotificationId.fromNotification(statusBarNotification);
@@ -185,20 +185,21 @@ public class NotificationsPlugin extends Plugin implements NotificationReceiver.
String packageName = statusBarNotification.getPackageName();
String appName = AppsHelper.appNameLookup(context, packageName);
//TODO: Add support for displaying app icons to desktop plasmoid and uncomment this piece of code
/*
try {
//TODO: Scale down app icon if too big and compress as JPG
Drawable drawableAppIcon = AppsHelper.appIconLookup(context, packageName);
Bitmap appIcon = ImagesHelper.drawableToBitmap(drawableAppIcon);
ByteArrayOutputStream outStream = new ByteArrayOutputStream();
appIcon.compress(Bitmap.CompressFormat.PNG, 90, outStream);
byte[] bitmapData = outStream.toByteArray();
byte[] serializedBitmapData = Base64.encode(bitmapData, Base64.NO_WRAP);
String stringBitmapData = new String(serializedBitmapData, Charset.defaultCharset());
//The icon is super big, better sending it as a file transfer when we support that
//np.set("base64icon", stringBitmapData);
np.setPayload(bitmapData);
} catch(Exception e) {
e.printStackTrace();
Log.e("NotificationsPlugin","Error retrieving icon");
}
*/
np.set("id", id.serialize());
np.set("appName", appName == null? packageName : appName);
@@ -224,7 +225,7 @@ public class NotificationsPlugin extends Plugin implements NotificationReceiver.
private void sendCurrentNotifications(NotificationReceiver service) {
StatusBarNotification[] notifications = service.getActiveNotifications();
for (StatusBarNotification notification : notifications) {
onNotificationPosted(notification, true);
sendNotification(notification, true);
}
}

View File

@@ -28,7 +28,7 @@ import java.util.HashMap;
public class DeviceActivity extends ActionBarActivity {
private String deviceId;
static private String deviceId; //Static because if we get here by using the back button in the action bar, the extra deviceId will not be set.
private Device device;
private Device.PluginsChangedListener pluginsChangedListener = new Device.PluginsChangedListener() {
@@ -58,7 +58,7 @@ public class DeviceActivity extends ActionBarActivity {
errorList.setOnItemClickListener(new AdapterView.OnItemClickListener() {
@Override
public void onItemClick(AdapterView<?> adapterView, View view, int position, long id) {
Plugin p = failedPlugins.get(ids[position - 1]); //Header is position 0, so we have to substract one
Plugin p = failedPlugins.get(ids[position - 1]); //Header is position 0, so we have to subtract one
p.getErrorDialog(DeviceActivity.this).show();
}
});
@@ -91,12 +91,15 @@ public class DeviceActivity extends ActionBarActivity {
actionBar.setDisplayOptions(ActionBar.DISPLAY_SHOW_HOME | ActionBar.DISPLAY_SHOW_TITLE);
actionBar.setDisplayHomeAsUpEnabled(true);
deviceId = getIntent().getStringExtra("deviceId");
if (getIntent().hasExtra("deviceId")) {
deviceId = getIntent().getStringExtra("deviceId");
}
BackgroundService.RunCommand(DeviceActivity.this, new BackgroundService.InstanceCallback() {
@Override
public void onServiceStart(BackgroundService service) {
device = service.getDevice(deviceId);
if (device == null) return;
setTitle(device.getName());
device.addPluginsChangedListener(pluginsChangedListener);
pluginsChangedListener.onPluginsChanged(device);

View File

@@ -28,6 +28,17 @@ public class DeviceItem implements ListAdapter.Item {
TextView titleView = (TextView)v.findViewById(R.id.list_item_entry_title);
if (titleView != null) titleView.setText(device.getName());
if (device.compareProtocolVersion() != 0) {
TextView summaryView = (TextView)v.findViewById(R.id.list_item_entry_summary);
summaryView.setVisibility(View.VISIBLE);
if (device.compareProtocolVersion() > 0) {
summaryView.setText(R.string.protocol_version_newer);
} else {
summaryView.setText(R.string.protocol_version_older);
}
} else {
v.findViewById(R.id.list_item_entry_summary).setVisibility(View.GONE);
}
v.setOnClickListener(new View.OnClickListener() {
@Override

View File

@@ -0,0 +1,33 @@
package org.kde.kdeconnect.UserInterface.List;
import android.app.Activity;
import android.content.Intent;
import android.view.LayoutInflater;
import android.view.View;
import android.widget.TextView;
import org.kde.kdeconnect.Device;
import org.kde.kdeconnect.UserInterface.DeviceActivity;
import org.kde.kdeconnect.UserInterface.PairActivity;
import org.kde.kdeconnect_tp.R;
public class EntryItem implements ListAdapter.Item {
private final String title;
public EntryItem(String title) {
this.title = title;
}
@Override
public View inflateView(LayoutInflater layoutInflater) {
View v = layoutInflater.inflate(R.layout.list_item_entry, null);
TextView titleView = (TextView)v.findViewById(R.id.list_item_entry_title);
if (titleView != null) titleView.setText(title);
return v;
}
}

View File

@@ -10,9 +10,10 @@ public class SectionItem implements ListAdapter.Item {
private final String title;
public boolean isEmpty;
public SectionItem(String title) {
this.title = title;
this.isEmpty = false;
}
@Override

View File

@@ -1,6 +1,7 @@
package org.kde.kdeconnect.UserInterface;
import android.content.Intent;
import android.content.res.Resources;
import android.os.Bundle;
import android.support.v7.app.ActionBar;
@@ -66,6 +67,9 @@ public class MainActivity extends ActionBarActivity {
}
}).start();
break;
case R.id.menu_settings:
startActivity(new Intent(this,MainSettingsActivity.class));
break;
default:
break;
}
@@ -79,7 +83,6 @@ public class MainActivity extends ActionBarActivity {
ActionBar actionBar = getSupportActionBar();
actionBar.setDisplayOptions(ActionBar.DISPLAY_SHOW_HOME | ActionBar.DISPLAY_SHOW_TITLE | ActionBar.DISPLAY_SHOW_CUSTOM);
}

View File

@@ -0,0 +1,103 @@
package org.kde.kdeconnect.UserInterface;
import android.annotation.TargetApi;
import android.content.Context;
import android.content.SharedPreferences;
import android.os.Build;
import android.os.Bundle;
import android.preference.EditTextPreference;
import android.preference.Preference;
import android.preference.PreferenceActivity;
import android.preference.PreferenceFragment;
import android.preference.PreferenceManager;
import android.util.Log;
import android.widget.Toast;
import org.kde.kdeconnect.HumanDeviceNames;
import org.kde.kdeconnect_tp.R;
public class MainSettingsActivity extends PreferenceActivity{
public static final String KEY_DEVICE_NAME_PREFERENCE = "device_name_preference";
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
initializeDeviceName(this);
if (Build.VERSION.SDK_INT < Build.VERSION_CODES.HONEYCOMB) {
addPreferencesOldApi();
} else {
getFragmentManager().beginTransaction().
replace(android.R.id.content, new GeneralPrefsFragment()).commit();
}
}
@SuppressWarnings("deprecation")
private void addPreferencesOldApi() {
addPreferencesFromResource(R.xml.general_preferences);
initPreferences((EditTextPreference) findPreference(KEY_DEVICE_NAME_PREFERENCE));
}
private void initPreferences(final EditTextPreference deviceNamePref) {
final SharedPreferences sharedPreferences=PreferenceManager.getDefaultSharedPreferences(this);
deviceNamePref.setOnPreferenceChangeListener(new Preference.OnPreferenceChangeListener() {
@Override
public boolean onPreferenceChange(Preference preference, Object newDeviceName) {
if (newDeviceName.toString().isEmpty()) {
Toast.makeText(
MainSettingsActivity.this,
getString(R.string.invalid_device_name),
Toast.LENGTH_SHORT).show();
return false;
}else{
Log.i("MainSettingsActivity", "New device name: " + newDeviceName);
deviceNamePref.setSummary(getString(
R.string.device_name_preference_summary,
newDeviceName.toString()));
return true;
}
}
});
deviceNamePref.setSummary(getString(
R.string.device_name_preference_summary,
sharedPreferences.getString(KEY_DEVICE_NAME_PREFERENCE,"")));
}
/**
* Until now it sets only the default deviceName (if not already set).
* It's safe to call this multiple time because doesn't override any previous value.
* @param context
*/
public static void initializeDeviceName(Context context){
// I could have used getDefaultSharedPreferences(context).contains but we need to check
// to checkAgainst empty String also.
String deviceName=PreferenceManager.getDefaultSharedPreferences(context).getString(
KEY_DEVICE_NAME_PREFERENCE,
"");
if(deviceName.isEmpty()){
Log.i("MainSettingsActivity", "New device name: " + deviceName);
PreferenceManager.getDefaultSharedPreferences(context).edit().putString(
KEY_DEVICE_NAME_PREFERENCE,
HumanDeviceNames.getDeviceName()).commit();
}
}
@TargetApi(Build.VERSION_CODES.HONEYCOMB)
public static class GeneralPrefsFragment extends PreferenceFragment {
@Override
public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
addPreferencesFromResource(R.xml.general_preferences);
}
@Override
public void onActivityCreated(Bundle savedInstanceState) {
super.onActivityCreated(savedInstanceState);
if (getActivity() != null) {
((MainSettingsActivity)getActivity()).initPreferences(
(EditTextPreference) findPreference(KEY_DEVICE_NAME_PREFERENCE));
}
}
}
}

View File

@@ -0,0 +1,298 @@
package org.kde.kdeconnect.UserInterface;
import android.content.ContentResolver;
import android.content.Intent;
import android.database.Cursor;
import android.net.Uri;
import android.os.Bundle;
import android.provider.MediaStore;
import android.support.v7.app.ActionBar;
import android.support.v7.app.ActionBarActivity;
import android.util.Log;
import android.view.Menu;
import android.view.MenuInflater;
import android.view.MenuItem;
import android.view.View;
import android.widget.AdapterView;
import android.widget.ListView;
import org.kde.kdeconnect.BackgroundService;
import org.kde.kdeconnect.Device;
import org.kde.kdeconnect.NetworkPackage;
import org.kde.kdeconnect.UserInterface.List.EntryItem;
import org.kde.kdeconnect.UserInterface.List.ListAdapter;
import org.kde.kdeconnect.UserInterface.List.SectionItem;
import org.kde.kdeconnect_tp.R;
import java.io.File;
import java.io.InputStream;
import java.net.URL;
import java.util.ArrayList;
import java.util.Collection;
public class ShareToReceiver extends ActionBarActivity {
//
// Action bar
//
private MenuItem menuProgress;
@Override
public boolean onCreateOptionsMenu(Menu menu) {
MenuInflater inflater = getMenuInflater();
inflater.inflate(R.menu.main, menu);
menuProgress = menu.findItem(R.id.menu_progress);
return true;
}
@Override
public boolean onOptionsItemSelected(final MenuItem item) {
switch (item.getItemId()) {
case R.id.menu_refresh:
updateComputerList();
BackgroundService.RunCommand(ShareToReceiver.this, new BackgroundService.InstanceCallback() {
@Override
public void onServiceStart(BackgroundService service) {
service.onNetworkChange();
}
});
item.setVisible(false);
menuProgress.setVisible(true);
new Thread(new Runnable() {
@Override
public void run() {
try { Thread.sleep(1500); } catch (InterruptedException e) { }
runOnUiThread(new Runnable() {
@Override
public void run() {
menuProgress.setVisible(false);
item.setVisible(true);
}
});
}
}).start();
break;
default:
break;
}
return true;
}
private void updateComputerList() {
final Intent intent = getIntent();
String action = intent.getAction();
if (!Intent.ACTION_SEND.equals(action) && !Intent.ACTION_SEND_MULTIPLE.equals(action)) {
finish();
return;
}
BackgroundService.RunCommand(this, new BackgroundService.InstanceCallback() {
@Override
public void onServiceStart(final BackgroundService service) {
Collection<Device> devices = service.getDevices().values();
final ArrayList<Device> devicesList = new ArrayList<Device>();
final ArrayList<ListAdapter.Item> items = new ArrayList<ListAdapter.Item>();
items.add(new SectionItem(getString(R.string.share_to)));
for (Device d : devices) {
if (d.isReachable() && d.isPaired()) {
devicesList.add(d);
items.add(new EntryItem(d.getName()));
}
}
runOnUiThread(new Runnable() {
@Override
public void run() {
ListView list = (ListView) findViewById(R.id.listView1);
list.setAdapter(new ListAdapter(ShareToReceiver.this, items));
list.setOnItemClickListener(new AdapterView.OnItemClickListener() {
@Override
public void onItemClick(AdapterView<?> adapterView, View view, int i, long l) {
Device device = devicesList.get(i-1); //NOTE: -1 because of the title!
Bundle extras = intent.getExtras();
if (extras.containsKey(Intent.EXTRA_STREAM)) {
try {
ArrayList<Uri> uriList;
if (!Intent.ACTION_SEND.equals(intent.getAction())) {
uriList = intent.getParcelableArrayListExtra(Intent.EXTRA_STREAM);
} else {
Uri uri = extras.getParcelable(Intent.EXTRA_STREAM);
uriList = new ArrayList<Uri>();
uriList.add(uri);
}
queuedSendUriList(device, uriList);
} catch (Exception e) {
Log.e(this.getClass().getName(), e.toString());
}
} else if (extras.containsKey(Intent.EXTRA_TEXT)) {
String text = extras.getString(Intent.EXTRA_TEXT);
boolean isUrl;
try {
new URL(text);
isUrl = true;
} catch(Exception e) {
isUrl = false;
}
NetworkPackage np = new NetworkPackage(NetworkPackage.PACKAGE_TYPE_SHARE);
if (isUrl) {
np.set("url", text);
} else {
np.set("text", text);
}
device.sendPackage(np);
}
finish();
}
});
}
});
}
});
}
private void queuedSendUriList(final Device device, final ArrayList<Uri> uriList) {
try {
Uri uri = uriList.remove(0);
ContentResolver cr = getContentResolver();
InputStream inputStream = cr.openInputStream(uri);
NetworkPackage np = new NetworkPackage(NetworkPackage.PACKAGE_TYPE_SHARE);
int size = -1;
if (uri.getScheme().equals("file")) {
// file:// is a non media uri, so we cannot query the ContentProvider
try {
size = (int)new File(uri.getPath()).length();
np.setPayload(inputStream, size);
} catch(Exception e) {
e.printStackTrace();
Log.e("ShareToReceiver", "Could not obtain file size");
}
try{
np.set("filename", uri.getLastPathSegment());
} catch (Exception e) {
e.printStackTrace();
Log.e("ShareToReceiver", "Could not obtain file name");
}
}else{
// Probably a content:// uri, so we query the Media content provider
String[] proj = { MediaStore.MediaColumns.DATA, MediaStore.MediaColumns.SIZE, MediaStore.MediaColumns.DISPLAY_NAME };
Cursor cursor = managedQuery(uri, proj, null, null, null);
try {
int column_index = cursor.getColumnIndexOrThrow(MediaStore.MediaColumns.SIZE);
cursor.moveToFirst();
size = cursor.getInt(column_index);
} catch(Exception e) {
e.printStackTrace();
Log.e("ShareToReceiver", "Could not obtain file size");
}
//Log.e("ShareToReceiver", "Size "+size);
np.setPayload(inputStream, size);
try {
int column_index = cursor.getColumnIndexOrThrow(MediaStore.MediaColumns.DATA);
cursor.moveToFirst();
String path = cursor.getString(column_index);
np.set("filename", Uri.parse(path).getLastPathSegment());
} catch(Exception _) {
try {
int column_index = cursor.getColumnIndexOrThrow(MediaStore.MediaColumns.DISPLAY_NAME);
cursor.moveToFirst();
String name = cursor.getString(column_index);
np.set("filename", name);
} catch (Exception e) {
e.printStackTrace();
Log.e("ShareToReceiver", "Could not obtain file name");
}
}
cursor.close();
}
device.sendPackage(np, new Device.SendPackageFinishedCallback() {
@Override
public void sendSuccessful() {
if (!uriList.isEmpty()) queuedSendUriList(device, uriList);
else Log.e("ShareToReceiver", "All files sent");
}
@Override
public void sendFailed() {
Log.e("ShareToReceiver", "Failed to send file");
}
});
} catch (Exception e) {
e.printStackTrace();
Log.e("ShareToReceiver", "Exception sending files");
}
}
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_main);
ActionBar actionBar = getSupportActionBar();
actionBar.setDisplayOptions(ActionBar.DISPLAY_SHOW_HOME | ActionBar.DISPLAY_SHOW_TITLE | ActionBar.DISPLAY_SHOW_CUSTOM);
setContentView(R.layout.activity_main);
}
@Override
protected void onStart() {
super.onStart();
BackgroundService.RunCommand(this, new BackgroundService.InstanceCallback() {
@Override
public void onServiceStart(BackgroundService service) {
service.onNetworkChange();
service.setDeviceListChangedCallback(new BackgroundService.DeviceListChangedCallback() {
@Override
public void onDeviceListChanged() {
updateComputerList();
}
});
}
});
}
@Override
protected void onStop() {
BackgroundService.RunCommand(this, new BackgroundService.InstanceCallback() {
@Override
public void onServiceStart(BackgroundService service) {
service.setDeviceListChangedCallback(null);
}
});
super.onStop();
}
@Override
protected void onResume() {
super.onResume();
updateComputerList();
}
}

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.1 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 557 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.8 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 750 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 365 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.0 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.5 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 713 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.5 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.4 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.2 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.9 KiB

View File

Before

Width:  |  Height:  |  Size: 6.7 KiB

After

Width:  |  Height:  |  Size: 6.7 KiB

View File

@@ -0,0 +1,32 @@
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="fill_parent"
android:baselineAligned="false"
android:layout_height="wrap_content"
android:minHeight="?android:attr/listPreferredItemHeight"
android:gravity="center_vertical"
android:paddingRight="?android:attr/scrollbarSize"
android:orientation="vertical">
<TextView android:id="@+id/list_item_entry_title"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:singleLine="true"
android:textAppearance="?android:attr/textAppearanceLarge"
android:ellipsize="marquee"
android:fadingEdge="horizontal"
android:text="" />
<TextView android:id="@+id/list_item_entry_summary"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:textAppearance="?android:attr/textAppearanceSmall"
android:singleLine="true"
android:textColor="#CC2222"
android:visibility="gone"
android:text="" />
</LinearLayout>

View File

@@ -37,7 +37,7 @@
<LinearLayout
android:orientation="horizontal"
android:layout_width="200dip"
android:layout_height="70dip"
android:layout_height="50dip"
android:layout_gravity="center"
>
@@ -45,19 +45,36 @@
android:layout_width="match_parent"
android:layout_height="fill_parent"
android:id="@+id/prev_button"
android:src="@android:drawable/ic_media_rew"
android:src="@android:drawable/ic_media_previous"
android:contentDescription="@string/mpris_previous"
android:layout_weight="0.5"
android:layout_weight="0.25"
/>
<ImageButton
android:layout_width="match_parent"
android:layout_height="fill_parent"
android:id="@+id/rew_button"
android:src="@android:drawable/ic_media_rew"
android:contentDescription="@string/mpris_rew"
android:layout_weight="0.25"
/>
<ImageButton
android:layout_width="match_parent"
android:layout_height="fill_parent"
android:id="@+id/ff_button"
android:src="@android:drawable/ic_media_ff"
android:contentDescription="@string/mpris_ff"
android:layout_weight="0.25"
/>
<ImageButton
android:layout_width="match_parent"
android:layout_height="fill_parent"
android:id="@+id/next_button"
android:src="@android:drawable/ic_media_ff"
android:layout_gravity="center"
android:src="@android:drawable/ic_media_next"
android:contentDescription="@string/mpris_next"
android:layout_weight="0.5"
android:layout_weight="0.25"
/>
</LinearLayout>
@@ -77,7 +94,7 @@
android:layout_weight="1"
android:layout_gravity="left|center_vertical"
android:contentDescription="@string/mpris_volume"
android:src="@drawable/volume"
android:src="@drawable/ic_volume"
/>
@@ -107,4 +124,4 @@
android:src="@android:drawable/ic_media_stop"
android:layout_gravity="center"/>
-->
</LinearLayout>
</LinearLayout>

View File

@@ -1,9 +1,9 @@
<menu xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:kdeconnect="http://schemas.android.com/apk/res-auto">
xmlns:kdeconnect="http://schemas.android.com/apk/res-auto/android">
<item
android:id="@+id/menu_refresh"
android:icon="@drawable/navigation_refresh"
android:icon="@drawable/ic_action_refresh"
android:orderInCategory="200"
kdeconnect:showAsAction="always"
android:title="@string/reconnect"
@@ -11,11 +11,17 @@
<item
android:id="@+id/menu_progress"
android:icon="@drawable/navigation_refresh"
android:orderInCategory="200"
android:visible="false"
kdeconnect:showAsAction="always"
kdeconnect:actionViewClass="android.widget.ProgressBar"
/>
<item
android:id="@+id/menu_settings"
android:icon="@drawable/ic_action_settings"
android:orderInCategory="300"
android:title="@string/settings"
kdeconnect:showAsAction="never"
/>
</menu>

View File

@@ -0,0 +1,28 @@
<?xml version='1.0' encoding='utf-8'?>
<resources>
<string name="pref_plugin_battery">Hlášení baterie</string>
<string name="pref_plugin_ping">Ping</string>
<string name="pref_plugin_ping_desc">Posílat a přijímat ping</string>
<string name="device_list_empty">Žádná zařízení</string>
<string name="ok">OK</string>
<string name="cancel">Zrušit</string>
<string name="open_settings">Otevřít nastavení</string>
<string name="send_ping">Poslat ping</string>
<string name="category_connected_devices">Připojená zařízení</string>
<string name="category_not_paired_devices">Nespárovaná zařízení</string>
<string name="category_remembered_devices">Zapamatovaná zařízení</string>
<string name="device_menu_plugins">Vyberte moduly</string>
<string name="error_timed_out">Čas vypršel</string>
<string name="error_canceled_by_user">Přerušeno uživatelem</string>
<string name="reconnect">Znovu připojit</string>
<string name="pairing_accept">Přijmout</string>
<string name="pairing_reject">Odmítnout</string>
<string name="device">Zařízení</string>
<string name="remote_control">Vzdálené ovládání</string>
<string name="mpris_play">Přehrát</string>
<string name="mpris_previous">Předchozí</string>
<string name="mpris_next">Následující</string>
<string name="mpris_volume">Hlasitost</string>
<string name="general_settings">Otevřít nastavení</string>
<string name="device_name">Zařízení</string>
</resources>

View File

@@ -0,0 +1,55 @@
<?xml version='1.0' encoding='utf-8'?>
<resources>
<string name="pref_plugin_telephony">Telefon-Benachrichtigung</string>
<string name="pref_plugin_telephony_desc">Benachrichtigungen über SMS und Anrufe senden</string>
<string name="pref_plugin_battery">Akkubericht</string>
<string name="pref_plugin_battery_desc">Akkustatus periodisch berichten</string>
<string name="pref_plugin_clipboard">Abgleich der Zwischenablage</string>
<string name="pref_plugin_clipboard_desc">Inhalt der Zwischenablage freigeben</string>
<string name="pref_plugin_mpris">Multimedia-Fernbedienungen</string>
<string name="pref_plugin_ping">Ping</string>
<string name="pref_plugin_ping_desc">Senden und Empfangen von Pings</string>
<string name="pref_plugin_notifications">Benachrichtigungs-Abgleich</string>
<string name="pref_plugin_notifications_desc">Zugriff auf Ihre Benachrichtigungen von anderen Geräten</string>
<string name="plugin_not_available">Diese Funktion ist in Ihrer Android-Version nicht verfügbar</string>
<string name="device_list_empty">Keine Geräte</string>
<string name="ok">OK</string>
<string name="cancel">Abbrechen</string>
<string name="open_settings">Einstellungen öffnen</string>
<string name="send_ping">Ping senden</string>
<string name="open_mpris_controls">Fernbedienung öffnen</string>
<string name="category_connected_devices">Verbundene Geräte</string>
<string name="category_not_paired_devices">Keine angeschlossenen Geräte</string>
<string name="device_menu_plugins">Module auswählen</string>
<string name="device_menu_unpair">Verbindung trennen</string>
<string name="unknown_device">Unbekanntes Gerät</string>
<string name="error_not_reachable">Das Gerät ist nicht erreichbar</string>
<string name="error_already_requested">Die Verbindung wurde bereits angefragt</string>
<string name="error_already_paired">Das Gerät ist bereits verbunden</string>
<string name="error_could_not_send_package">Das Paket kann nicht gesendet werden</string>
<string name="error_timed_out">Zeitüberschreitung</string>
<string name="error_canceled_by_user">Abbruch durch Benutzer</string>
<string name="error_canceled_by_other_peer">Abbruch durch Gegenstelle</string>
<string name="error_invalid_key">Ungültiger Schlüssel empfangen</string>
<string name="pair_requested">Verbindung angefordert</string>
<string name="pairing_request_from">Verbindungsanfrage von %1s</string>
<string name="reconnect">Erneut verbinden</string>
<string name="device_not_paired">Das Gerät ist nicht verbunden</string>
<string name="request_pairing">Verbindung angefordert</string>
<string name="pairing_accept">Annehmen</string>
<string name="pairing_reject">Ablehnen</string>
<string name="device">Gerät</string>
<string name="pair_device">Gerät verbinden</string>
<string name="remote_control">Fernbedienung</string>
<string name="settings">KDE-Verbindungseinstellungen</string>
<string name="mpris_play">Wiedergabe</string>
<string name="mpris_previous">Zurück</string>
<string name="mpris_next">Weiter</string>
<string name="mpris_volume">Lautstärke</string>
<string name="protocol_version_older">Dieses Gerät verwendet ein alte Protokollversion</string>
<string name="protocol_version_newer">Dieses Gerät verwendet ein neuere Protokollversion</string>
<string name="general_settings">Allgemeine Einstellungen</string>
<string name="device_name">Gerätename</string>
<string name="device_name_preference_summary">%s</string>
<string name="invalid_device_name">Ungültiger Gerätename</string>
</resources>

View File

@@ -0,0 +1,60 @@
<?xml version='1.0' encoding='utf-8'?>
<resources>
<string name="pref_plugin_telephony">Notificador de telefonía</string>
<string name="pref_plugin_telephony_desc">Enviar notificaciones de SMS y llamadas</string>
<string name="pref_plugin_battery">Informe de la batería</string>
<string name="pref_plugin_battery_desc">Informar periódicamente del estado de la batería</string>
<string name="pref_plugin_clipboard">Sincronización del portapapeles</string>
<string name="pref_plugin_clipboard_desc">Compartir el contenido del portapapeles</string>
<string name="pref_plugin_mpris">Controles remotos multimedia</string>
<string name="pref_plugin_mpris_desc">Controlar audio y vídeo desde el teléfono</string>
<string name="pref_plugin_ping">Ping</string>
<string name="pref_plugin_ping_desc">Enviar y recibir pings</string>
<string name="pref_plugin_notifications">Sincronizar notificaciones</string>
<string name="pref_plugin_notifications_desc">Acceder a las notificaciones desde otros dispositivos</string>
<string name="plugin_not_available">Esta función no está disponible en su versión de Android</string>
<string name="device_list_empty">Ningún dispositivo</string>
<string name="ok">Aceptar</string>
<string name="cancel">Cancelar</string>
<string name="open_settings">Abrir preferencias</string>
<string name="no_permissions">Debe otorgar permiso para acceder a las notificaciones</string>
<string name="send_ping">Enviar ping</string>
<string name="open_mpris_controls">Abrir control remoto</string>
<string name="category_connected_devices">Dispositivos conectados</string>
<string name="category_not_paired_devices">Dispositivos no vinculados</string>
<string name="category_remembered_devices">Dispositivos recordados</string>
<string name="plugins_failed_to_load">Complementos cuya carga ha fallado (toque para más información):</string>
<string name="device_menu_plugins">Seleccionar complementos</string>
<string name="device_menu_unpair">Desvincular</string>
<string name="unknown_device">Dispositivo desconocido</string>
<string name="error_not_reachable">No se encuentra el dispositivo</string>
<string name="error_already_requested">Ya ha solicitado vincularse</string>
<string name="error_already_paired">Dispositivo ya vinculado</string>
<string name="error_could_not_send_package">No se puede enviar el paquete</string>
<string name="error_timed_out">Se ha agotado el tiempo</string>
<string name="error_canceled_by_user">Cancelado por el usuario</string>
<string name="error_canceled_by_other_peer">Cancelado por la otra parte</string>
<string name="error_invalid_key">Se ha recibido una clave no valida</string>
<string name="pair_requested">Vinculación solicitada</string>
<string name="pairing_request_from">Solicitud de vinculación de %1s</string>
<string name="tap_to_answer">Toque para responder</string>
<string name="reconnect">Reconectar</string>
<string name="device_not_paired">Dispositivo no vinculado</string>
<string name="request_pairing">Solicitar vinculación</string>
<string name="pairing_accept">Aceptar</string>
<string name="pairing_reject">Rechazar</string>
<string name="device">Dispositivo</string>
<string name="pair_device">Vincular dispositivo</string>
<string name="remote_control">Control remoto</string>
<string name="settings">Preferencias de KDE Connect</string>
<string name="mpris_play">Reproducir</string>
<string name="mpris_previous">Anterior</string>
<string name="mpris_next">Siguiente</string>
<string name="mpris_volume">Volumen</string>
<string name="share_to">Compartir con...</string>
<string name="protocol_version_older">Este dispositivo usa una versión antigua del protocolo</string>
<string name="protocol_version_newer">Este dispositivo usa una versión más reciente del protocolo</string>
<string name="general_settings">Abrir preferencias</string>
<string name="device_name">Dispositivo no vinculado</string>
<string name="invalid_device_name">Se ha recibido una clave no valida</string>
</resources>

View File

@@ -0,0 +1,57 @@
<?xml version='1.0' encoding='utf-8'?>
<resources>
<string name="pref_plugin_telephony">Notificateur de téléphonie</string>
<string name="pref_plugin_telephony_desc">Envoie des notifications pour les SMS et les appels</string>
<string name="pref_plugin_battery">Rapport sur la batterie</string>
<string name="pref_plugin_battery_desc">Rapport périodique sur l\'état de la batterie</string>
<string name="pref_plugin_clipboard">Synchronisation avec le presse-papiers</string>
<string name="pref_plugin_clipboard_desc">Partage le contenu du presse-papiers</string>
<string name="pref_plugin_mpris">Contrôles distants multimédia</string>
<string name="pref_plugin_mpris_desc">Contrôle l\'audio / la vidéo depuis votre téléphone</string>
<string name="pref_plugin_ping">Commande « Ping »</string>
<string name="pref_plugin_ping_desc">Envoie et reçoit des commandes « Ping »</string>
<string name="pref_plugin_notifications">Synchronisation des notifications</string>
<string name="pref_plugin_notifications_desc">Accédez à vos notifications depuis d\'autres périphériques</string>
<string name="plugin_not_available">Cette fonctionnalité n\'est pas disponible dans votre version de Android</string>
<string name="device_list_empty">Pas de périphériques</string>
<string name="ok">Ok</string>
<string name="cancel">Annuler</string>
<string name="open_settings">Accéder aux paramètres</string>
<string name="no_permissions">Vous devez accorder la permission d\'accéder aux notifications</string>
<string name="send_ping">Envoyer un « Ping »</string>
<string name="open_mpris_controls">Ouvrir un contrôle distant</string>
<string name="category_connected_devices">Périphériques connectés</string>
<string name="category_not_paired_devices">Pas de périphériques appariés</string>
<string name="category_remembered_devices">Périphériques mémorisés</string>
<string name="plugins_failed_to_load">Le chargement des modules externes a échoué (cliquez pour plus d\'informations) :</string>
<string name="device_menu_plugins">Sélectionner des modules externes</string>
<string name="device_menu_unpair">Désapparier</string>
<string name="unknown_device">Périphérique inconnu</string>
<string name="error_not_reachable">Périphérique inaccessible</string>
<string name="error_already_requested">L\'appariement a déjà été demandé</string>
<string name="error_already_paired">Périphérique déjà apparié</string>
<string name="error_could_not_send_package">Il est impossible d\'envoyer un paquet</string>
<string name="error_timed_out">Délai expiré</string>
<string name="error_canceled_by_user">Annulé par l\'utilisateur</string>
<string name="error_canceled_by_other_peer">Annulé par un autre homologue</string>
<string name="error_invalid_key">Clé reçue non valable</string>
<string name="pair_requested">Paire demandée</string>
<string name="pairing_request_from">Demande d\'appariement provenant de %1s</string>
<string name="tap_to_answer">Cliquer pour répondre</string>
<string name="reconnect">Reconnecter</string>
<string name="device_not_paired">Périphérique non apparié</string>
<string name="request_pairing">Demande d\'appariement</string>
<string name="pairing_accept">Accepter</string>
<string name="pairing_reject">Rejeter</string>
<string name="device">Périphérique</string>
<string name="pair_device">Apparier un périphérique</string>
<string name="remote_control">Contrôle distant</string>
<string name="settings">Paramètres de connexion de KDE</string>
<string name="mpris_play">Lire</string>
<string name="mpris_previous">Précédent</string>
<string name="mpris_next">Suivant</string>
<string name="mpris_volume">Volume</string>
<string name="general_settings">Accéder aux paramètres</string>
<string name="device_name">Périphérique non apparié</string>
<string name="invalid_device_name">Clé reçue non valable</string>
</resources>

View File

@@ -0,0 +1,60 @@
<?xml version='1.0' encoding='utf-8'?>
<resources>
<string name="pref_plugin_telephony">Telefon értesítő</string>
<string name="pref_plugin_telephony_desc">Értesítés küldése SMS-hez és hívásokhoz</string>
<string name="pref_plugin_battery">Akkumulátor jelentés</string>
<string name="pref_plugin_battery_desc">Akkumulátorállapot időszakos jelentése</string>
<string name="pref_plugin_clipboard">Vágólap szinkronizáció</string>
<string name="pref_plugin_clipboard_desc">A vágólap tartalmának megosztása</string>
<string name="pref_plugin_mpris">Multimedia távirányítók</string>
<string name="pref_plugin_mpris_desc">Hang vagy videó vezérlése a telefonról</string>
<string name="pref_plugin_ping">Ping</string>
<string name="pref_plugin_ping_desc">Pingek küldése és fogadása</string>
<string name="pref_plugin_notifications">Értesítés szinkronizáció</string>
<string name="pref_plugin_notifications_desc">Hozzáférés az értesítésekhez más eszközökről</string>
<string name="plugin_not_available">Ez a funkció nem érhető el az ön Android verziójában</string>
<string name="device_list_empty">Nincsenek eszközök</string>
<string name="ok">OK</string>
<string name="cancel">Mégse</string>
<string name="open_settings">Beállítások megnyitása</string>
<string name="no_permissions">Jogot kell adnia az értesítésekhez való hozzáféréshez</string>
<string name="send_ping">Ping küldése</string>
<string name="open_mpris_controls">Távirányító megnyitása</string>
<string name="category_connected_devices">Csatlakoztatott eszközök</string>
<string name="category_not_paired_devices">Nincsenek párosított eszközök</string>
<string name="category_remembered_devices">Megjegyzett eszközök</string>
<string name="plugins_failed_to_load">A bővítményeket nem sikerült betölteni (érintse meg a további információkért):</string>
<string name="device_menu_plugins">Bővítmények kijelölése</string>
<string name="device_menu_unpair">Leválasztás</string>
<string name="unknown_device">Ismeretlen eszköz</string>
<string name="error_not_reachable">Az eszköz nem érhető el</string>
<string name="error_already_requested">A párosítás már kérve lett</string>
<string name="error_already_paired">Az eszköz már párosítva van</string>
<string name="error_could_not_send_package">Nem sikerült elküldeni a csomagot</string>
<string name="error_timed_out">Időtúllépés</string>
<string name="error_canceled_by_user">Megszakítva a felhasználó által</string>
<string name="error_canceled_by_other_peer">A másik partner megszakította</string>
<string name="error_invalid_key">Érvénytelen kulcs érkezett</string>
<string name="pair_requested">Párosítás kérve</string>
<string name="pairing_request_from">Párosítási kérés innen: %1s</string>
<string name="tap_to_answer">Érintse meg a válaszhoz</string>
<string name="reconnect">Újracsatlakozás</string>
<string name="device_not_paired">Az eszköz nincs párosítva</string>
<string name="request_pairing">Párosítás kérése</string>
<string name="pairing_accept">Elfogadás</string>
<string name="pairing_reject">Elutasítás</string>
<string name="device">Eszköz</string>
<string name="pair_device">Eszköz párosítása</string>
<string name="remote_control">Távirányító</string>
<string name="settings">KDE csatlakozás beállítások</string>
<string name="mpris_play">Lejátszás</string>
<string name="mpris_previous">Előző</string>
<string name="mpris_next">Következő</string>
<string name="mpris_volume">Hangerő</string>
<string name="share_to">Megosztás…</string>
<string name="protocol_version_older">Ez az eszköz egy régi protokollverziót használ</string>
<string name="protocol_version_newer">Ez az eszköz egy újabb protokollverziót használ</string>
<string name="general_settings">Beállítások megnyitása</string>
<string name="device_name">Az eszköz nincs párosítva</string>
<string name="invalid_device_name">Érvénytelen kulcs érkezett</string>
</resources>

View File

@@ -0,0 +1,63 @@
<?xml version='1.0' encoding='utf-8'?>
<resources>
<string name="pref_plugin_telephony">Telefoniemelder</string>
<string name="pref_plugin_telephony_desc">Stuur meldingen voor SMS en oproepen</string>
<string name="pref_plugin_battery">Batterijrapportage</string>
<string name="pref_plugin_battery_desc">Rapporteer periodiek de status van de batterij</string>
<string name="pref_plugin_clipboard">Klembordsynchronisatie</string>
<string name="pref_plugin_clipboard_desc">De inhoud van het klembord delen</string>
<string name="pref_plugin_mpris">Afstandsbediening van multimedia</string>
<string name="pref_plugin_mpris_desc">Bedien de audio/video vanaf uw telefoon</string>
<string name="pref_plugin_ping">Ping</string>
<string name="pref_plugin_ping_desc">Pings verzenden en ontvangen</string>
<string name="pref_plugin_notifications">Synchronisatie van meldingen</string>
<string name="pref_plugin_notifications_desc">Bekijk uw meldingen van andere apparaten</string>
<string name="plugin_not_available">Deze functie is niet beschikbaar in uw versie van Android</string>
<string name="device_list_empty">Geen apparaten</string>
<string name="ok">OK</string>
<string name="cancel">Annuleren</string>
<string name="open_settings">Instellingen openen</string>
<string name="no_permissions">U moet toestemming geven voor toegang tot meldingen</string>
<string name="send_ping">Ping verzenden</string>
<string name="open_mpris_controls">Afstandsbediening openen</string>
<string name="category_connected_devices">Verbonden apparaten</string>
<string name="category_not_paired_devices">Geen gepaarde apparaten</string>
<string name="category_remembered_devices">Onthouden apparaten</string>
<string name="plugins_failed_to_load">Laden van plug-ins is mislukt (tap voor meer informatie):</string>
<string name="device_menu_plugins">Plug-ins selecteren</string>
<string name="device_menu_unpair">Paar uit elkaar halen</string>
<string name="unknown_device">Onbekend apparaat</string>
<string name="error_not_reachable">Apparaat niet bereikbaar</string>
<string name="error_already_requested">Paar maken is al gevraagd</string>
<string name="error_already_paired">Apparaat is al gepaard</string>
<string name="error_could_not_send_package">Kon pakket niet verzenden</string>
<string name="error_timed_out">Tijdslimiet overschreden</string>
<string name="error_canceled_by_user">Geannuleerd door gebruiker</string>
<string name="error_canceled_by_other_peer">Geannuleerd door andere kant</string>
<string name="error_invalid_key">Ongeldige sleutel ontvangen</string>
<string name="pair_requested">Paar gevraagd</string>
<string name="pairing_request_from">Verzoek om een paar te maken van %1s</string>
<string name="tap_to_answer">Tap om te antwoorden</string>
<string name="reconnect">Opnieuw verbinden</string>
<string name="device_not_paired">Apparaat is niet gepaard</string>
<string name="request_pairing">Verzoek voor maken van paar</string>
<string name="pairing_accept">Accepteren</string>
<string name="pairing_reject">Afwijzen</string>
<string name="device">Apparaat</string>
<string name="pair_device">Apparaat voor paar</string>
<string name="remote_control">Afstandsbediening</string>
<string name="settings">Instellingen van KDE Connect</string>
<string name="mpris_play">Afspelen</string>
<string name="mpris_previous">Vorige</string>
<string name="mpris_rew">Terugspoelen</string>
<string name="mpris_ff">Snel vooruit</string>
<string name="mpris_next">Volgende</string>
<string name="mpris_volume">Volume</string>
<string name="share_to">Delen met...</string>
<string name="protocol_version_older">Dit apparaat gebruikt een oude protocolversie</string>
<string name="protocol_version_newer">Dit apparaat gebruikt een nieuwere protocolversie</string>
<string name="general_settings">Algemene instellingen</string>
<string name="device_name">Apparaatnaam</string>
<string name="device_name_preference_summary">%s</string>
<string name="invalid_device_name">Ongeldige apparaatnaam</string>
</resources>

View File

@@ -0,0 +1,63 @@
<?xml version='1.0' encoding='utf-8'?>
<resources>
<string name="pref_plugin_telephony">Notificação telefônica</string>
<string name="pref_plugin_telephony_desc">Envia notificações de SMS e chamadas</string>
<string name="pref_plugin_battery">Relatório da bateria</string>
<string name="pref_plugin_battery_desc">Informa o status da bateria periodicamente</string>
<string name="pref_plugin_clipboard">Sincronizar área de transferência</string>
<string name="pref_plugin_clipboard_desc">Compartilha o conteúdo da área de transferência</string>
<string name="pref_plugin_mpris">Controle remoto multimídia</string>
<string name="pref_plugin_mpris_desc">Controla áudio e vídeo a partir do seu telefone</string>
<string name="pref_plugin_ping">Ping</string>
<string name="pref_plugin_ping_desc">Envia e recebe pings</string>
<string name="pref_plugin_notifications">Sincronização de notificações</string>
<string name="pref_plugin_notifications_desc">Acesse suas notificações a partir de outros dispositivos</string>
<string name="plugin_not_available">Esta funcionalidade não está disponível na sua versão do Android</string>
<string name="device_list_empty">Sem dispositivos</string>
<string name="ok">OK</string>
<string name="cancel">Cancelar</string>
<string name="open_settings">Abrir configurações</string>
<string name="no_permissions">Você precisa conceder permissão para acessar as notificações</string>
<string name="send_ping">Enviar ping</string>
<string name="open_mpris_controls">Abra o controle remoto</string>
<string name="category_connected_devices">Dispositivos conectados</string>
<string name="category_not_paired_devices">Dispositivos não emparelhados</string>
<string name="category_remembered_devices">Dispositivos lembrados</string>
<string name="plugins_failed_to_load">Plugins não carregados (toque para mais informações):</string>
<string name="device_menu_plugins">Selecionar plugins</string>
<string name="device_menu_unpair">Cancelar emparelhamento</string>
<string name="unknown_device">Dispositivo desconhecido</string>
<string name="error_not_reachable">Dispositivo inacessível</string>
<string name="error_already_requested">O emparelhamento já foi solicitado</string>
<string name="error_already_paired">Dispositivo já emparelhado</string>
<string name="error_could_not_send_package">Não foi possível enviar o pacote</string>
<string name="error_timed_out">Tempo limite expirou</string>
<string name="error_canceled_by_user">Cancelado pelo usuário</string>
<string name="error_canceled_by_other_peer">Cancelado pelo outro dispositivo</string>
<string name="error_invalid_key">Chave inválida recebida</string>
<string name="pair_requested">Emparelhamento solicitado</string>
<string name="pairing_request_from">Emparelhando solicitação de %1s</string>
<string name="tap_to_answer">Toque para responder</string>
<string name="reconnect">Reconectar</string>
<string name="device_not_paired">Dispositivo não emparelhado</string>
<string name="request_pairing">Solicitar emparelhamento</string>
<string name="pairing_accept">Aceitar</string>
<string name="pairing_reject">Rejeitar</string>
<string name="device">Dispositivo</string>
<string name="pair_device">Emparelhar dispositivo</string>
<string name="remote_control">Controle remoto</string>
<string name="settings">Configurações do KDE Connect</string>
<string name="mpris_play">Reproduzir</string>
<string name="mpris_previous">Anterior</string>
<string name="mpris_rew">Retornar</string>
<string name="mpris_ff">Avançar rapidamente</string>
<string name="mpris_next">Próximo</string>
<string name="mpris_volume">Volume</string>
<string name="share_to">Compartilhar com...</string>
<string name="protocol_version_older">Este dispositivo usa uma versão antiga do protocolo</string>
<string name="protocol_version_newer">Este dispositivo usa uma versão mais recente do protocolo</string>
<string name="general_settings">Configurações gerais</string>
<string name="device_name">Nome do dispositivo</string>
<string name="device_name_preference_summary">%s</string>
<string name="invalid_device_name">Nome do dispositivo inválido</string>
</resources>

View File

@@ -0,0 +1,63 @@
<?xml version='1.0' encoding='utf-8'?>
<resources>
<string name="pref_plugin_telephony">Notificação telefónica</string>
<string name="pref_plugin_telephony_desc">Enviar notificações para os SMS\'s e chamadas</string>
<string name="pref_plugin_battery">Relatório da bateria</string>
<string name="pref_plugin_battery_desc">Comunicar periodicamente o estado da bateria</string>
<string name="pref_plugin_clipboard">Sincronização da área de transferência</string>
<string name="pref_plugin_clipboard_desc">Partilhar o conteúdo da área de transferência</string>
<string name="pref_plugin_mpris">Comando à distância multimédia</string>
<string name="pref_plugin_mpris_desc">Controlar o áudio/vídeo a partir do seu telefone</string>
<string name="pref_plugin_ping">Contacto</string>
<string name="pref_plugin_ping_desc">Enviar e receber pedidos de contacto (\'ping\')</string>
<string name="pref_plugin_notifications">Sincronização da notificação</string>
<string name="pref_plugin_notifications_desc">Aceder às suas notificações a partir de outros dispositivos</string>
<string name="plugin_not_available">Esta funcionalidade não está disponível na sua versão do Android</string>
<string name="device_list_empty">Sem dispositivos</string>
<string name="ok">OK</string>
<string name="cancel">Cancelar</string>
<string name="open_settings">Abrir a configuração</string>
<string name="no_permissions">Precisa de dar permissões de acesso às notificações</string>
<string name="send_ping">Enviar um pedido de contacto</string>
<string name="open_mpris_controls">Abrir o comando à distância</string>
<string name="category_connected_devices">Dispositivos ligados</string>
<string name="category_not_paired_devices">Dispositivos não emparelhados</string>
<string name="category_remembered_devices">Dispositivos recordados</string>
<string name="plugins_failed_to_load">Não foi possível carregar os \'plugin\' (toque para mais informações):</string>
<string name="device_menu_plugins">Seleccionar os \'plugins\'</string>
<string name="device_menu_unpair">Desemparelhar</string>
<string name="unknown_device">Dispositivo desconhecido</string>
<string name="error_not_reachable">Dispositivo inacessível</string>
<string name="error_already_requested">O emparelhamento já foi pedido</string>
<string name="error_already_paired">O dispositivo já foi emparelhado</string>
<string name="error_could_not_send_package">Não foi possível enviar o pacote</string>
<string name="error_timed_out">Expirou o tempo-limite</string>
<string name="error_canceled_by_user">Cancelado pelo utilizador</string>
<string name="error_canceled_by_other_peer">Cancelado pela outra máquina</string>
<string name="error_invalid_key">Chave inválida recebida</string>
<string name="pair_requested">Emparelhamento pedido</string>
<string name="pairing_request_from">Pedido de emparelhamento de %1s</string>
<string name="tap_to_answer">Toque para responder</string>
<string name="reconnect">Ligar de Novo</string>
<string name="device_not_paired">Dispositivo não emparelhado</string>
<string name="request_pairing">Pedir o emparelhamento</string>
<string name="pairing_accept">Aceitar</string>
<string name="pairing_reject">Rejeitar</string>
<string name="device">Dispositivo</string>
<string name="pair_device">Emparelhar o dispositivo</string>
<string name="remote_control">Comando à distância</string>
<string name="settings">Configuração do KDE Connect</string>
<string name="mpris_play">Tocar</string>
<string name="mpris_previous">Anterior</string>
<string name="mpris_rew">Recuar</string>
<string name="mpris_ff">Avançar</string>
<string name="mpris_next">Seguinte</string>
<string name="mpris_volume">Volume</string>
<string name="share_to">Partilhar Com...</string>
<string name="protocol_version_older">Este dispositivo usa uma versão antiga do protocolo</string>
<string name="protocol_version_newer">Este dispositivo usa uma versão mais recente do protocolo</string>
<string name="general_settings">Configuração Geral</string>
<string name="device_name">Nome do dispositivo</string>
<string name="device_name_preference_summary">%s</string>
<string name="invalid_device_name">Nome do dispositivo inválido</string>
</resources>

View File

@@ -0,0 +1,60 @@
<?xml version='1.0' encoding='utf-8'?>
<resources>
<string name="pref_plugin_telephony">Уведомления телефонии</string>
<string name="pref_plugin_telephony_desc">Отправлять уведомления о SMS и звонках</string>
<string name="pref_plugin_battery">Состояние батареи</string>
<string name="pref_plugin_battery_desc">Периодически сообщать о состоянии батареи</string>
<string name="pref_plugin_clipboard">Синхронизация буфера обмена</string>
<string name="pref_plugin_clipboard_desc">Сделать содержимое буфера обмена общим</string>
<string name="pref_plugin_mpris">ДУ для мультимедия</string>
<string name="pref_plugin_mpris_desc">Управление аудио/видео с устройства</string>
<string name="pref_plugin_ping">Пинг</string>
<string name="pref_plugin_ping_desc">Посылать и получать пинги</string>
<string name="pref_plugin_notifications">Синхронизация уведомлений</string>
<string name="pref_plugin_notifications_desc">Доступ к уведомлениям с других устройств</string>
<string name="plugin_not_available">Этот функционал недоступен в вашей версии Android</string>
<string name="device_list_empty">Нет устройств</string>
<string name="ok">OK</string>
<string name="cancel">Отмена</string>
<string name="open_settings">Открыть настройки</string>
<string name="no_permissions">Вы должны разрешить доступ к уведомлениям</string>
<string name="send_ping">Послать пинг</string>
<string name="open_mpris_controls">Открыть дистанционное управление</string>
<string name="category_connected_devices">Подключённые устройства</string>
<string name="category_not_paired_devices">Не спаренные устройства</string>
<string name="category_remembered_devices">Запомненные устройства</string>
<string name="plugins_failed_to_load">Сбой загрузки следующих модулей (прикоснитесь чтобы получить подробности):</string>
<string name="device_menu_plugins">Выбрать модули</string>
<string name="device_menu_unpair">Разделить спаренные устройства</string>
<string name="unknown_device">Неизвестное устройство</string>
<string name="error_not_reachable">Устройство недоступно</string>
<string name="error_already_requested">Запрос на спаривание уже был сделан</string>
<string name="error_already_paired">Устройство уже спарено</string>
<string name="error_could_not_send_package">Не удалось послать пакет</string>
<string name="error_timed_out">Истекло время ожидания</string>
<string name="error_canceled_by_user">Отменено пользователем</string>
<string name="error_canceled_by_other_peer">Отменено другим участником</string>
<string name="error_invalid_key">Недопустимый получатель ключа</string>
<string name="pair_requested">Запрошено спаривание</string>
<string name="pairing_request_from">Запрос на спаривание от %1s</string>
<string name="tap_to_answer">Коснитесь чтобы ответить</string>
<string name="reconnect">Переподключить</string>
<string name="device_not_paired">Устройство не спарено</string>
<string name="request_pairing">Запросить спаривание</string>
<string name="pairing_accept">Принять</string>
<string name="pairing_reject">Отклонить</string>
<string name="device">Устройство</string>
<string name="pair_device">Спарить устройство</string>
<string name="remote_control">Дистанционное управление</string>
<string name="settings">Настройки KDE Connect</string>
<string name="mpris_play">Воспроизвести</string>
<string name="mpris_previous">Предыдущий</string>
<string name="mpris_next">Следующее</string>
<string name="mpris_volume">Громкость</string>
<string name="share_to">Сделать общим с...</string>
<string name="protocol_version_older">Это устройство использует старую версию протокола</string>
<string name="protocol_version_newer">Это устройство использует более свежую версию протокола</string>
<string name="general_settings">Открыть настройки</string>
<string name="device_name">Устройство не спарено</string>
<string name="invalid_device_name">Недопустимый получатель ключа</string>
</resources>

View File

@@ -0,0 +1,60 @@
<?xml version='1.0' encoding='utf-8'?>
<resources>
<string name="pref_plugin_telephony">Telefónny notifikátor</string>
<string name="pref_plugin_telephony_desc">Poslať pripomienky pre SMS a hovory</string>
<string name="pref_plugin_battery">Oznam o batérii</string>
<string name="pref_plugin_battery_desc">Periodicky oznamovať stav batérie</string>
<string name="pref_plugin_clipboard">Synchronizácia schránky</string>
<string name="pref_plugin_clipboard_desc">Zdieľať obsah schránky</string>
<string name="pref_plugin_mpris">Multimediálne diaľkové ovládače</string>
<string name="pref_plugin_mpris_desc">Ovládať audio/video z vášho telefónu</string>
<string name="pref_plugin_ping">Ping</string>
<string name="pref_plugin_ping_desc">Poslať a prijať pingy</string>
<string name="pref_plugin_notifications">Synchronizácia pripomienok</string>
<string name="pref_plugin_notifications_desc">Prístup k vašim pripomienkam z iných zariadení</string>
<string name="plugin_not_available">Táto funkcia nie je dostupná vo vašej verzii Androidu</string>
<string name="device_list_empty">Žiadne zariadenia</string>
<string name="ok">OK</string>
<string name="cancel">Zrušiť</string>
<string name="open_settings">Otvoriť nastavenia</string>
<string name="no_permissions">Musíte povoliť oprávnenia na prístup k pripomienkam</string>
<string name="send_ping">Poslať ping</string>
<string name="open_mpris_controls">Otvoriť diaľkové ovládanie</string>
<string name="category_connected_devices">Pripojené zariadenia</string>
<string name="category_not_paired_devices">Nespárované zariadenia</string>
<string name="category_remembered_devices">Zapamätané zariadenia</string>
<string name="plugins_failed_to_load">Zlyhalo načítanie pluginov (tapnite pre viac info):</string>
<string name="device_menu_plugins">Vybrať pluginy</string>
<string name="device_menu_unpair">Odpárovať</string>
<string name="unknown_device">Neznáme zariadenie</string>
<string name="error_not_reachable">Zariadenie nedostupné</string>
<string name="error_already_requested">Spárovanie už vyžiadané</string>
<string name="error_already_paired">Zariadenie už spárované</string>
<string name="error_could_not_send_package">Nemôžem poslať balík</string>
<string name="error_timed_out">Čas vypršal</string>
<string name="error_canceled_by_user">Zrušené používateľom</string>
<string name="error_canceled_by_other_peer">Zrušené iným klientom</string>
<string name="error_invalid_key">Získaný nesprávny kľúč</string>
<string name="pair_requested">Spárovanie vyžiadané</string>
<string name="pairing_request_from">Požiadavka na spárovanie od %1s</string>
<string name="tap_to_answer">Tapnite na odpoveď</string>
<string name="reconnect">Znovu pripojiť</string>
<string name="device_not_paired">Zariadenie nespárované</string>
<string name="request_pairing">Požiadavka na spárovanie</string>
<string name="pairing_accept">Prijať</string>
<string name="pairing_reject">Odmietnuť</string>
<string name="device">Zariadenie</string>
<string name="pair_device">Spárovať zariadenie</string>
<string name="remote_control">Diaľkové ovládanie</string>
<string name="settings">Nastavenia KDE Connect</string>
<string name="mpris_play">Prehrať</string>
<string name="mpris_previous">Predošlé</string>
<string name="mpris_next">Nasledovné</string>
<string name="mpris_volume">Hlasitosť</string>
<string name="share_to">Zdieľať pre...</string>
<string name="protocol_version_older">Toto zariadenie používa starú verziu protokolu</string>
<string name="protocol_version_newer">Toto zariadenie používa novšiu verziu protokolu</string>
<string name="general_settings">Otvoriť nastavenia</string>
<string name="device_name">Zariadenie nespárované</string>
<string name="invalid_device_name">Získaný nesprávny kľúč</string>
</resources>

View File

@@ -0,0 +1,63 @@
<?xml version='1.0' encoding='utf-8'?>
<resources>
<string name="pref_plugin_telephony">Telefonunderrättelser</string>
<string name="pref_plugin_telephony_desc">Skicka underrättelser för SMS och samtal</string>
<string name="pref_plugin_battery">Batterirapport</string>
<string name="pref_plugin_battery_desc">Rapportera periodiskt batteriets status</string>
<string name="pref_plugin_clipboard">Synkronisera klippbord</string>
<string name="pref_plugin_clipboard_desc">Dela klippbordets innehåll</string>
<string name="pref_plugin_mpris">Fjärrkontroll av multimedia</string>
<string name="pref_plugin_mpris_desc">Styr ljud och video från telefonen</string>
<string name="pref_plugin_ping">Ping</string>
<string name="pref_plugin_ping_desc">Skicka och ta emot ping</string>
<string name="pref_plugin_notifications">Synkronisering av underrättelser</string>
<string name="pref_plugin_notifications_desc">Kom åt underrättelser från andra apparater</string>
<string name="plugin_not_available">Funktionen är inte tillgänglig i Android-versionen</string>
<string name="device_list_empty">Inga apparater</string>
<string name="ok">Ok</string>
<string name="cancel">Avbryt</string>
<string name="open_settings">Öppna inställningarna</string>
<string name="no_permissions">Du måste ge rättighet att komma åt underrättelser</string>
<string name="send_ping">Skicka ping</string>
<string name="open_mpris_controls">Öppna fjärrkontroll</string>
<string name="category_connected_devices">Anslutna apparater</string>
<string name="category_not_paired_devices">Inga parade apparater</string>
<string name="category_remembered_devices">Ihågkomna apparater</string>
<string name="plugins_failed_to_load">Misslyckades ladda insticksprogram (rör för mer information):</string>
<string name="device_menu_plugins">Välj insticksprogram</string>
<string name="device_menu_unpair">Ta bort ihopparning</string>
<string name="unknown_device">Okänd apparat</string>
<string name="error_not_reachable">Apparaten kan inte nås</string>
<string name="error_already_requested">Ihopparning redan begärd</string>
<string name="error_already_paired">Apparat redan ihopparad</string>
<string name="error_could_not_send_package">Kunde inte skicka paket</string>
<string name="error_timed_out">Tidsgräns överskriden</string>
<string name="error_canceled_by_user">Avbruten av användaren</string>
<string name="error_canceled_by_other_peer">Avbruten av motparten</string>
<string name="error_invalid_key">Ogiltig nyckel mottagen</string>
<string name="pair_requested">Ihopparning begärd</string>
<string name="pairing_request_from">Begäran om ihopparning från %1s</string>
<string name="tap_to_answer">Rör för att svara</string>
<string name="reconnect">Anslut igen</string>
<string name="device_not_paired">Apparat inte ihopparad</string>
<string name="request_pairing">Begära ihopparning</string>
<string name="pairing_accept">Acceptera</string>
<string name="pairing_reject">Avslå</string>
<string name="device">Apparat</string>
<string name="pair_device">Para ihop apparat</string>
<string name="remote_control">Fjärrkontroll</string>
<string name="settings">KDE anslutningsinställningar</string>
<string name="mpris_play">Spela</string>
<string name="mpris_previous">Föregående</string>
<string name="mpris_rew">Snabbspola bakåt</string>
<string name="mpris_ff">Snabbspola framåt</string>
<string name="mpris_next">Nästa</string>
<string name="mpris_volume">Volym</string>
<string name="share_to">Dela med...</string>
<string name="protocol_version_older">Apparaten använder en gammal protokollversion</string>
<string name="protocol_version_newer">Apparaten använder en nyare protokollversion</string>
<string name="general_settings">Allmänna inställningar</string>
<string name="device_name">Apparatnamn</string>
<string name="device_name_preference_summary">%s</string>
<string name="invalid_device_name">Ogiltigt apparatnamn</string>
</resources>

View File

@@ -0,0 +1,63 @@
<?xml version='1.0' encoding='utf-8'?>
<resources>
<string name="pref_plugin_telephony">Телефонний сповіщувач</string>
<string name="pref_plugin_telephony_desc">Надсилання сповіщень щодо SMS та дзвінків</string>
<string name="pref_plugin_battery">Звіт щодо заряду</string>
<string name="pref_plugin_battery_desc">Періодична інформація щодо стану акумулятора</string>
<string name="pref_plugin_clipboard">Синхронізація буфера</string>
<string name="pref_plugin_clipboard_desc">Спільне використання буфера обміну даними</string>
<string name="pref_plugin_mpris">Дистанційне керування відтворенням</string>
<string name="pref_plugin_mpris_desc">Керування відтворенням звуку та відео з вашого телефону</string>
<string name="pref_plugin_ping">Підтримання зв’язку</string>
<string name="pref_plugin_ping_desc">Надсилання і отримання сигналів підтримання зв’язку</string>
<string name="pref_plugin_notifications">Синхронізація сповіщень</string>
<string name="pref_plugin_notifications_desc">Доступ до ваших сповіщень з інших пристроїв</string>
<string name="plugin_not_available">Ця можливість є недоступною для вашої версії для Android</string>
<string name="device_list_empty">Немає пристроїв</string>
<string name="ok">Гаразд</string>
<string name="cancel">Скасувати</string>
<string name="open_settings">Відкрити вікно параметрів</string>
<string name="no_permissions">Вам слід надати доступ до сповіщень</string>
<string name="send_ping">Надіслати сигнал підтримання зв’язку</string>
<string name="open_mpris_controls">Відкрити дистанційне керування</string>
<string name="category_connected_devices">З’єднані пристрої</string>
<string name="category_not_paired_devices">Непов’язані пристрої</string>
<string name="category_remembered_devices">Відомі пристрої</string>
<string name="plugins_failed_to_load">Додатки, які не вдалося завантажити (натисніть, щоб дізнатися більше):</string>
<string name="device_menu_plugins">Виберіть додатки</string>
<string name="device_menu_unpair">Скасувати пов’язування</string>
<string name="unknown_device">Невідомий пристрій</string>
<string name="error_not_reachable">Немає доступу до пристрою</string>
<string name="error_already_requested">Запит щодо пов’язування вже надіслано</string>
<string name="error_already_paired">Пристрій вже пов’язано</string>
<string name="error_could_not_send_package">Не вдалося надіслати пакунок</string>
<string name="error_timed_out">Час очікування вичерпано</string>
<string name="error_canceled_by_user">Скасовано користувачем</string>
<string name="error_canceled_by_other_peer">Скасовано з іншого вузла пов’язування</string>
<string name="error_invalid_key">Отримано некоректний ключ</string>
<string name="pair_requested">Запит щодо пов’язування</string>
<string name="pairing_request_from">Запит щодо пов’язування від %1s</string>
<string name="tap_to_answer">Натисніть, щоб відповісти</string>
<string name="reconnect">З\'єднати знову</string>
<string name="device_not_paired">Пристрій не пов’язано</string>
<string name="request_pairing">Надіслати запит щодо пов’язування</string>
<string name="pairing_accept">Прийняти</string>
<string name="pairing_reject">Відмовити</string>
<string name="device">Пристрій</string>
<string name="pair_device">Пов’язати пристрій</string>
<string name="remote_control">Дистанційне керування</string>
<string name="settings">Параметри з’єднання з KDE</string>
<string name="mpris_play">Пуск</string>
<string name="mpris_previous">Назад</string>
<string name="mpris_rew">Повний назад</string>
<string name="mpris_ff">Повний вперед</string>
<string name="mpris_next">Далі</string>
<string name="mpris_volume">Гучність</string>
<string name="share_to">Спільно використовувати з…</string>
<string name="protocol_version_older">На цьому пристрої використовується стара версія протоколу</string>
<string name="protocol_version_newer">На цьому пристрої використовується новіша версія протоколу</string>
<string name="general_settings">Загальні параметри</string>
<string name="device_name">Назва пристрою</string>
<string name="device_name_preference_summary">%s</string>
<string name="invalid_device_name">Некоректна назва пристрою</string>
</resources>

View File

@@ -50,7 +50,16 @@
<string name="settings">KDE Connect Settings</string>
<string name="mpris_play">Play</string>
<string name="mpris_previous">Previous</string>
<string name="mpris_rew">Rewind</string>
<string name="mpris_ff">Fast-forward</string>
<string name="mpris_next">Next</string>
<string name="mpris_volume">Volume</string>
<string name="share_to">Share To...</string>
<string name="protocol_version_older">This device uses an old protocol version</string>
<string name="protocol_version_newer">This device uses a newer protocol version</string>
<string name="general_settings">General Settings</string>
<string name="device_name">Device name</string>
<string name="device_name_preference_summary">%s</string>
<string name="invalid_device_name">Invalid device name</string>
</resources>

View File

@@ -0,0 +1,15 @@
<?xml version="1.0" encoding="utf-8"?>
<PreferenceScreen xmlns:android="http://schemas.android.com/apk/res/android">
<PreferenceCategory
android:title="@string/general_settings">
<EditTextPreference
android:key="device_name_preference"
android:title="@string/device_name"
android:summary="@string/device_name_preference_summary"
android:dialogTitle="@string/device_name"
android:singleLine="true" />
</PreferenceCategory>
</PreferenceScreen>