Commit Graph

282 Commits

Author SHA1 Message Date
Florian Schmaus d2f5efcb20 Use StandardCharsets.(UTF_8|US_ASCII)
This also gets rid of a ton of UnsupportedEncodingException s.
2019-05-08 12:44:48 +02:00
Florian Schmaus 7f0dc72dab Update errorprone(-plugin) and make Unused(Variable|Method) an error 2019-05-07 23:09:00 +02:00
Florian Schmaus 68d7d738b6 Remove all tabs and add checkstyle rule that enforces no-tabs
Fixes SMACK-866.
2019-05-07 21:24:00 +02:00
Florian Schmaus 505493d889 Add XmlStringBuilder.optAttribute(String, Number) 2019-05-07 10:18:55 +02:00
Florian Schmaus 4133eb175c Replace XPP3 by XmlPullParser interface wrapping StAX and XPP3
Introducing Smack's own XmlPullParser interface which tries to stay as
compatible as possible to XPP3. The interface is used to either wrap
StAX's XMLStreamReader if Smack is used on Java SE, and XPP3's
XmlPullParser if Smack is used on on Android.

Fixes SMACK-591.

Also introduce JUnit 5 and non-strict javadoc projects.
2019-05-06 22:10:50 +02:00
Florian Schmaus 474ea68d4a Remove unused method in Smack's Base64 API 2019-04-09 10:56:47 +02:00
Florian Schmaus 62fd897cf7 Add support for XEP-0418: DNS Queries over XMPP (DoX)
Fixes SMACK-862.
2019-04-09 10:56:47 +02:00
Florian Schmaus 1122bf394c Add ExceptionUtil 2019-04-09 09:33:32 +02:00
Florian Schmaus 7d5274dad1 Use java.util.Base64 and remove build-in Base64 API 2019-04-09 09:33:32 +02:00
Florian Schmaus 89c0fa4b99 Let StringUtils.(insecure)randomString() return empty string
in case length is zero. Also do throw a NegativeArraySizeException if
length is negative instead of returning null.

This fixes the following sporadic test issue:

org.jivesoftware.smackx.ox.PainlessOpenPgpProviderTest > encryptDecryptTest FAILED
java.lang.AssertionError
at org.jivesoftware.smack.util.XmlStringBuilder.escape(XmlStringBuilder.java:425)
at org.jivesoftware.smackx.ox.element.EncryptedOpenPgpContentElement.addCommonXml(EncryptedOpenPgpContentElement.java:65)
at org.jivesoftware.smackx.ox.element.CryptElement.toXML(CryptElement.java:51)
at org.jivesoftware.smackx.ox.element.CryptElement.toXML(CryptElement.java:31)
at org.jivesoftware.smack.packet.Element.toXML(Element.java:41)
at org.jivesoftware.smackx.ox.element.OpenPgpContentElement.toInputStream(OpenPgpContentElement.java:186)
at org.jivesoftware.smackx.ox.crypto.PainlessOpenPgpProvider.encrypt(PainlessOpenPgpProvider.java:136)
at org.jivesoftware.smackx.ox.PainlessOpenPgpProviderTest.encryptDecryptTest(PainlessOpenPgpProviderTest.java:155)

because EncryptedOpenPgpContentElement rpad field was sometimes
'null' in case the random function returned '0' as length.
2019-03-25 18:58:58 +01:00
Florian Schmaus 14f288a763 Introduce RandomUtil
and use it in EncryptedOpenPgpContentElement
2019-03-25 18:58:58 +01:00
Florian Schmaus 488e20476e Improve message of StressTestFailedException.NotAllMessagesReceivedException 2019-02-17 21:47:16 +01:00
Florian Schmaus b3ed9bc29f Add BooleansUtils 2019-02-17 18:21:57 +01:00
Florian Schmaus 8df69bd3ce Use XmlEnvironment in parsing/provider subsystem 2019-02-15 23:21:30 +01:00
Florian Schmaus 7dee3b88a2 Introduce SmackParsingException 2019-02-10 19:01:47 +01:00
Florian Schmaus 083dac8b83 Rework exceptions in the parsing / provider subsystem 2019-02-05 13:18:03 +01:00
Florian Schmaus fee3ed81ca Introduce XmlEnvironment 2019-02-05 13:18:03 +01:00
Florian Schmaus 5705f18f58 Remove SmackDaneVerifier.finish(SSLSocket) 2019-02-05 13:18:03 +01:00
Florian Schmaus 658fd08d20 Use try-with-resources where possible
and make StanzaCollector implement AutoCloseable.
2019-02-05 13:18:03 +01:00
Florian Schmaus e98d42790a SmackReactor/NIO, Java8/Android19, Pretty print XML, FSM connections
This commit adds
- SmackReactor / NIO
- a framework for finite state machine connections
- support for Java 8
- pretty printed XML debug output

It also
- reworks the integration test framework
- raises the minimum Android API level to 19
- introduces XmppNioTcpConnection

Furthermore fixes SMACK-801 (at least partly). Java 8 language
features are available, but not all runtime library methods. For that
we would need to raise the Android API level to 24 or higher.
2019-02-05 13:18:03 +01:00
Florian Schmaus 62a0c6f26e Merge branch '4.3' 2018-11-29 22:39:55 +01:00
Florian Schmaus 7ea7f9e2e9 Add ParserUtils.parseXmlBoolean(String) 2018-11-29 09:02:05 +01:00
Georg Lukas 229653af30 ParserUtils: fix boolean parser
How could this even happen?

Signed-off-by: Georg Lukas <georg@op-co.de>
2018-11-28 11:11:52 +01:00
Paul Schaub 9302b08854
Use new BareJidEncoder class in FileBasedOmemoStore 2018-11-07 18:17:25 +01:00
Florian Schmaus 00ce194109 Use Enum.toString() instead of Enum.name() in XmlStringBuilder.optElement() 2018-10-19 11:12:57 +02:00
Florian Schmaus ab120691cb Smack 4.3.1
-----BEGIN PGP SIGNATURE-----
 
 iQGTBAABCgB9FiEEl3UFnzoh3OFr5PuuIjmn6PWFIFIFAlvDIBdfFIAAAAAALgAo
 aXNzdWVyLWZwckBub3RhdGlvbnMub3BlbnBncC5maWZ0aGhvcnNlbWFuLm5ldDk3
 NzUwNTlGM0EyMURDRTE2QkU0RkJBRTIyMzlBN0U4RjU4NTIwNTIACgkQIjmn6PWF
 IFKObAgApvEwstvSXhgzlrA46DM6fXezbPEnO1rh8rCPJEAsmfBSnyINSuuhelzw
 zN8L7GAU0jDeuDivxA12vQx5QB8wuCHKgc5pXDKNRi9eUdsyDUMKswcbMMAJWDvq
 I3bm7TOC1D9ZWmfhGmqfulrsVD1Q0wh+P2A1/CWVR5ZZUB5S4fESFZUrnCfJmeXe
 f+INXUiui3otAF6nPxKm782rSfHWvA32i4Obnagh3oPX/c9R7Ftb78Wukrsbaqfg
 +a5iTlBJXLG75/Yozq+JqmWlUvEKv7le0vkF5fF+oc76H4p1U1wqQyIMei/Pwaer
 H/SyMqLPzCiwpUHiunpWD13e5kkeLw==
 =47on
 -----END PGP SIGNATURE-----

Merge tag '4.3.1'

Smack 4.3.1
2018-10-14 14:31:31 +02:00
Florian Schmaus cf22371d3e Catch IllegalArgumentException in XmlUtil clinit
Fixes SMACK-833.
2018-10-14 12:10:50 +02:00
Florian Schmaus b60a772df1 Remove unnecessary getNamespace() call in XmlStringBuilder 2018-10-03 20:09:56 +02:00
Florian Schmaus 09279b8ac0 Add AbstractBlockingQueueWithShutdown.putAll(Collection) 2018-09-11 21:56:45 +02:00
Florian Schmaus 7374caefef Make StringEncoder generic 2018-08-21 11:09:26 +02:00
Florian Schmaus fb3009adb2 Add FileUtils.maybeCreateFileWithParentDirectories(File) 2018-08-17 13:00:34 +02:00
Florian Schmaus a70ae7ab8e Add FileUtils.maybeDeleteFileOrThrow(File) 2018-08-17 13:00:34 +02:00
Florian Schmaus 3e65cb31c3 Consolidate FileUtils from smack-openpgp into smack-core 2018-08-15 17:36:29 +02:00
Florian Schmaus a00aa726fe Introduce CloseableUtil 2018-08-15 17:25:22 +02:00
Florian Schmaus 6fb95d6226 Close stream in FileUtils.addLines() 2018-08-13 16:39:56 +02:00
Paul Schaub d78733e23a
Remove duplicate FileUtils methods 2018-07-30 16:05:58 +02:00
Paul Schaub f0af00ee43
XEP-0373, XEP-0374: OpenPGP for XMPP: Instant Messaging
Fixes SMACK-826
2018-07-29 18:52:45 +02:00
Paul Schaub 74bebc13e6
requireNotNullOrEmpty -> requireNotNullNorEmpty 2018-07-17 15:10:39 +02:00
Paul Schaub 4afe573a68
Add Objects.requireNonNullOrEmpty 2018-07-17 11:39:51 +02:00
Florian Schmaus ce4f3352a2 Merge branch '4.3' 2018-06-23 17:18:17 +02:00
Florian Schmaus 23bb5c5625 Add XMPPErrorException.getStanzaError()
Also deprecate getXMPPError and let StanzaError implement
ExtensionElement.
2018-06-20 22:17:11 +02:00
Florian Schmaus c83f6ec9c8 Merge branch '4.3' 2018-06-17 14:10:52 +02:00
Florian Schmaus 37b5260cdd Fix DNSUtil.setDaneProvider()
Fixes SMACK-820.
2018-06-12 19:06:18 +02:00
Florian Schmaus f290197f6a Merge branch '4.3' 2018-06-12 15:49:43 +02:00
Florian Schmaus 1edc00b334 Merge remote-tracking branch 'ignite/master' 2018-06-12 15:49:00 +02:00
Florian Schmaus 9e865fe6ab Merge remote-tracking branch 'ignite/4.3' into 4.3 2018-06-12 13:41:43 +02:00
Florian Schmaus c792be9267 Add StringUtils.requireNullOrNotEmpty() 2018-06-07 17:55:00 +02:00
Florian Schmaus 414d730962 Optimize XmlStringBuilder.element() for the empty element case
For example RSM (XEP-0059) gives <before/> a different semantic as
<before>UID</before>.
2018-06-07 17:15:16 +02:00
Florian Schmaus 8f691e4b1d Add ArrayBlockingQueueWithShutdown.tryTake() 2018-05-31 17:20:09 +02:00
Florian Schmaus 751c7b0d40 Improve ArrayBlockingQueueWithShutdown.tryPut()
to return the internal state when the operation is performed.
2018-05-31 17:19:36 +02:00