diff --git a/build.gradle b/build.gradle
index a60ed7b22..f21541ea7 100755
--- a/build.gradle
+++ b/build.gradle
@@ -2,11 +2,12 @@
buildscript {
repositories {
- jcenter()
+ google()
mavenCentral()
+ jcenter()
}
dependencies {
- classpath 'com.android.tools.build:gradle:2.2.3'
+ classpath 'com.android.tools.build:gradle:4.2.2'
// NOTE: Do not place your application dependencies here; they belong
// in the individual module build.gradle files
}
@@ -14,23 +15,22 @@ buildscript {
ext{
- compileSdkVersion = 24
- buildToolsVersion = '23.0.3'
+ compileSdkVersion = 32
group = 'org.eclipse.paho'
- sampleArchivesBaseName = 'org.eclipse.paho.android.sample'
- sampleVersion = '1.1.1'
+ sampleArchivesBaseName = 'inder.paho.mqtt'
+ sampleVersion = '1.1.3'
- serviceArchivesBaseName = 'org.eclipse.paho.android.service'
- serviceVersion = '1.1.1'
+ serviceArchivesBaseName = 'inder.paho.mqtt'
+ serviceVersion = '1.1.4'
clientVersion = '1.1.0'
mavenUrl = "https://repo.eclipse.org/content/repositories/paho-releases/"
- supportLibVersion = '24.2.1'
+ supportLibVersion = '27.0.2'
}
@@ -57,6 +57,8 @@ println "SDK dir: $sdkDir"
allprojects {
repositories {
+ google()
+ mavenCentral()
jcenter()
maven {
url "file://$sdkDir/extras/android/m2repository/"
diff --git a/gradle/wrapper/gradle-wrapper.properties b/gradle/wrapper/gradle-wrapper.properties
index 978247479..4d9ca1649 100644
--- a/gradle/wrapper/gradle-wrapper.properties
+++ b/gradle/wrapper/gradle-wrapper.properties
@@ -1,6 +1,5 @@
-#Tue Jan 24 11:18:55 GMT 2017
distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
+distributionUrl=https\://services.gradle.org/distributions/gradle-6.7.1-bin.zip
zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists
-distributionUrl=https\://services.gradle.org/distributions/gradle-2.14.1-all.zip
diff --git a/jitpack.yml b/jitpack.yml
new file mode 100644
index 000000000..faa03d22f
--- /dev/null
+++ b/jitpack.yml
@@ -0,0 +1,4 @@
+jdk:
+ - openjdk11
+before_install:
+ - ./scripts/prepareJitpackEnvironment.sh
diff --git a/org.eclipse.paho.android.sample/build.gradle b/org.eclipse.paho.android.sample/build.gradle
index c33f156ce..2e509d6ae 100644
--- a/org.eclipse.paho.android.sample/build.gradle
+++ b/org.eclipse.paho.android.sample/build.gradle
@@ -2,12 +2,12 @@ apply plugin: 'com.android.application'
android {
compileSdkVersion rootProject.ext.compileSdkVersion
- buildToolsVersion rootProject.ext.buildToolsVersion
+ // buildToolsVersion rootProject.ext.buildToolsVersion
defaultConfig {
applicationId rootProject.ext.sampleArchivesBaseName
minSdkVersion 16
- targetSdkVersion 24
+ targetSdkVersion 32
versionCode 1
versionName "0.1"
}
@@ -32,13 +32,13 @@ repositories {
dependencies {
- //compile fileTree(dir: '../org.eclipse.paho.android/service/libs', excludes: ["org.eclipse.paho.client.mqttv3-${rootProject.ext.clientVersion}.jar"], include: '')
- compile "com.android.support:appcompat-v7:${rootProject.ext.supportLibVersion}"
- compile "com.android.support:recyclerview-v7:${rootProject.ext.supportLibVersion}"
- compile "org.eclipse.paho:org.eclipse.paho.client.mqttv3:${rootProject.ext.clientVersion}"
- compile (project(':org.eclipse.paho.android.service')){
- //exclude module: "org.eclipse.paho.client.mqttv3"
- transitive=true
+ implementation fileTree(dir: '../org.eclipse.paho.android/service/libs', include: '')
+ implementation "com.android.support:appcompat-v7:${rootProject.ext.supportLibVersion}"
+ implementation "com.android.support:recyclerview-v7:${rootProject.ext.supportLibVersion}"
+ implementation "org.eclipse.paho:org.eclipse.paho.client.mqttv3:${rootProject.ext.clientVersion}"
+ implementation(project(':org.eclipse.paho.android.service')){
+ // exclude module: "org.eclipse.paho.client.mqttv3"
+ //transitive=true
}
}
@@ -48,7 +48,7 @@ task publishAPK(type: Copy) {
}
-configurations.compile.exclude module: 'org.eclipse.paho.client.mqttv3'
-task debug << {
+//configurations.compile.exclude module: 'org.eclipse.paho.client.mqttv3'
+task debug doLast {
configurations.compile.each { println it}
}
diff --git a/org.eclipse.paho.android.sample/src/main/AndroidManifest.xml b/org.eclipse.paho.android.sample/src/main/AndroidManifest.xml
index 65d3cd7d0..6374ba8dd 100644
--- a/org.eclipse.paho.android.sample/src/main/AndroidManifest.xml
+++ b/org.eclipse.paho.android.sample/src/main/AndroidManifest.xml
@@ -24,7 +24,8 @@
* The default options are specified in {@link MqttConnectOptions} class. *
- * + * * @throws MqttException * for any connected problems * @return token used to track and wait for the connect to complete. The @@ -313,14 +313,14 @@ public IMqttToken connect() throws MqttException { return connect(null, null); } - + /** * Connects to an MQTT server using the provided connect options. ** The connection will be established using the options specified in the * {@link MqttConnectOptions} parameter. *
- * + * * @param options * a set of connection parameters that override the defaults. * @throws MqttException @@ -339,7 +339,7 @@ public IMqttToken connect(MqttConnectOptions options) throws MqttException { ** The default options are specified in {@link MqttConnectOptions} class. *
- * + * * @param userContext * optional object used to pass context to the callback. Use null * if not required. @@ -377,7 +377,7 @@ public IMqttToken connect(Object userContext, IMqttActionListener callback) ** When building an application, the design of the topic tree should take * into account the following principles of topic name syntax and semantics: *
- * + * ** The following principles apply to the construction and content of a topic * tree: *
- * + * ** Provides an optimized way to subscribe to multiple topics compared to * subscribing to each one individually. *
- * + * * @param topic * one or more topics to subscribe to, which can include * wildcards @@ -867,7 +867,7 @@ public IMqttToken subscribe(String topic, int qos) throws MqttException, * for security related problems * @throws MqttException * for non security related problems - * + * * @see #subscribe(String[], int[], Object, IMqttActionListener) */ @Override @@ -878,7 +878,7 @@ public IMqttToken subscribe(String[] topic, int[] qos) /** * Subscribe to a topic, which may include wildcards. - * + * * @param topic * the topic to subscribe to, which can include wildcards. * @param qos @@ -897,7 +897,7 @@ public IMqttToken subscribe(String[] topic, int[] qos) * token will be passed to callback methods if set. * @throws MqttException * if there was an error when registering the subscription. - * + * * @see #subscribe(String[], int[], Object, IMqttActionListener) */ @Override @@ -943,7 +943,7 @@ public IMqttToken subscribe(String topic, int qos, Object userContext, * the client connects with the same client ID the server will * deliver the stored messages to the client. * - * + * ** The "topic filter" string is used when subscription may contain special * characters, which allows you to subscribe to multiple topics at once. @@ -953,7 +953,7 @@ public IMqttToken subscribe(String topic, int qos, Object userContext, * tree and provide a hierarchical structure to the topic space. The use of * the topic level separator is significant when the two wildcard characters * are encountered in topics specified by subscribers. - * + * *
@@ -974,7 +974,7 @@ public IMqttToken subscribe(String topic, int qos, Object userContext, * # represents zero levels. The topic level separator is * meaningless in this context, because there are no levels to separate. *
- * + * ** The multi-level wildcard can be specified only on its own or * next to the topic level separator character. Therefore, # and @@ -984,7 +984,7 @@ public IMqttToken subscribe(String topic, int qos, Object userContext, * finance/#/closingprice is not valid. *
*@@ -995,7 +995,7 @@ public IMqttToken subscribe(String topic, int qos, Object userContext, * wildcard matches only a single level, finance/+ does not match * finance. *
- * + * ** Use the single-level wildcard at any level in the topic tree, and in * conjunction with the multilevel wildcard. Specify the single-level @@ -1017,7 +1017,7 @@ public IMqttToken subscribe(String topic, int qos, Object userContext, * or *
- *
+ *
* @param callback
* which will be invoked for certain asynchronous events
- *
+ *
* @see MqttCallback
*/
@Override
@@ -1313,11 +1313,11 @@ public void setCallback(MqttCallback callback) {
this.callback = callback;
}
-
+
/**
* identify the callback to be invoked when making tracing calls back into
* the Activity
- *
+ *
* @param traceCallback handler
*/
public void setTraceCallback(MqttTraceHandler traceCallback) {
@@ -1327,18 +1327,18 @@ public void setTraceCallback(MqttTraceHandler traceCallback) {
/**
* turn tracing on and off
- *
+ *
* @param traceEnabled
* set true
to enable trace, otherwise, set
* false
to disable trace
- *
+ *
*/
public void setTraceEnabled(boolean traceEnabled) {
this.traceEnabled = traceEnabled;
if (mqttService !=null)
mqttService.setTraceEnabled(traceEnabled);
}
-
+
/**
*
* Process incoming Intent objects representing the results of operations @@ -1395,7 +1395,7 @@ else if (MqttServiceConstants.DISCONNECT_ACTION.equals(action)) { else if (MqttServiceConstants.TRACE_ACTION.equals(action)) { traceAction(data); }else{ - mqttService.traceError(MqttService.TAG, "Callback action doesn't exist."); + mqttService.traceError(MqttService.TAG, "Callback action doesn't exist."); } } @@ -1403,7 +1403,7 @@ else if (MqttServiceConstants.TRACE_ACTION.equals(action)) { /** * Acknowledges a message received on the * {@link MqttCallback#messageArrived(String, MqttMessage)} - * + * * @param messageId * the messageId received from the MqttMessage (To access this * field you need to cast {@link MqttMessage} to @@ -1418,24 +1418,24 @@ public boolean acknowledgeMessage(String messageId) { return false; } - + public void messageArrivedComplete(int messageId, int qos) throws MqttException { - throw new UnsupportedOperationException(); + throw new UnsupportedOperationException(); } - + public void setManualAcks(boolean manualAcks) { - throw new UnsupportedOperationException(); + throw new UnsupportedOperationException(); } /** * Process the results of a connection - * + * * @param data */ private void connectAction(Bundle data) { IMqttToken token = connectToken; removeMqttToken(data); - + simpleAction(token, data); } @@ -1443,7 +1443,7 @@ private void connectAction(Bundle data) { /** * Process a notification that we have disconnected - * + * * @param data */ private void disconnected(Bundle data) { @@ -1459,7 +1459,7 @@ private void disconnected(Bundle data) { /** * Process a Connection Lost notification - * + * * @param data */ private void connectionLostAction(Bundle data) { @@ -1483,7 +1483,7 @@ private void connectExtendedAction(Bundle data){ /** * Common processing for many notifications - * + * * @param token * the token associated with the action being undertake * @param data @@ -1501,13 +1501,13 @@ private void simpleAction(IMqttToken token, Bundle data) { ((MqttTokenAndroid) token).notifyFailure(exceptionThrown); } } else { - mqttService.traceError(MqttService.TAG, "simpleAction : token is null"); + mqttService.traceError(MqttService.TAG, "simpleAction : token is null"); } } /** * Process notification of a publish(send) operation - * + * * @param data */ private void sendAction(Bundle data) { @@ -1518,7 +1518,7 @@ private void sendAction(Bundle data) { /** * Process notification of a subscribe operation - * + * * @param data */ private void subscribeAction(Bundle data) { @@ -1528,7 +1528,7 @@ private void subscribeAction(Bundle data) { /** * Process notification of an unsubscribe operation - * + * * @param data */ private void unSubscribeAction(Bundle data) { @@ -1538,7 +1538,7 @@ private void unSubscribeAction(Bundle data) { /** * Process notification of a published message having been delivered - * + * * @param data */ private void messageDeliveredAction(Bundle data) { @@ -1556,7 +1556,7 @@ private void messageDeliveredAction(Bundle data) { /** * Process notification of a message's arrival - * + * * @param data */ private void messageArrivedAction(Bundle data) { @@ -1585,10 +1585,10 @@ private void messageArrivedAction(Bundle data) { } } } - + /** * Process trace action - pass trace data back to the callback - * + * * @param data */ private void traceAction(Bundle data) { @@ -1597,9 +1597,9 @@ private void traceAction(Bundle data) { String severity = data.getString(MqttServiceConstants.CALLBACK_TRACE_SEVERITY); String message = data.getString(MqttServiceConstants.CALLBACK_ERROR_MESSAGE); String tag = data.getString(MqttServiceConstants.CALLBACK_TRACE_TAG); - if (MqttServiceConstants.TRACE_DEBUG.equals(severity)) + if (MqttServiceConstants.TRACE_DEBUG.equals(severity)) traceCallback.traceDebug(tag, message); - else if (MqttServiceConstants.TRACE_ERROR.equals(severity)) + else if (MqttServiceConstants.TRACE_ERROR.equals(severity)) traceCallback.traceError(tag, message); else { @@ -1608,7 +1608,7 @@ else if (MqttServiceConstants.TRACE_ERROR.equals(severity)) } } } - + /** * @param token * identifying an operation @@ -1622,12 +1622,12 @@ private synchronized String storeToken(IMqttToken token) { /** * Get a token identified by a string, and remove it from our map - * + * * @param data * @return the token */ private synchronized IMqttToken removeMqttToken(Bundle data) { - + String activityToken = data.getString(MqttServiceConstants.CALLBACK_ACTIVITY_TOKEN); if (activityToken!=null){ int tokenNumber = Integer.parseInt(activityToken); @@ -1640,7 +1640,7 @@ private synchronized IMqttToken removeMqttToken(Bundle data) { /** * Get a token identified by a string, and remove it from our map - * + * * @param data * @return the token */ @@ -1669,14 +1669,14 @@ public MqttMessage getBufferedMessage(int bufferIndex){ public void deleteBufferedMessage(int bufferIndex){ mqttService.deleteBufferedMessage(clientHandle, bufferIndex); } - + /** * Get the SSLSocketFactory using SSL key store and password *
* A convenience method, which will help user to create a SSLSocketFactory * object *
- * + * * @param keyStore * the SSL key store which is generated by some SSL key tool, * such as keytool in Java JDK @@ -1693,17 +1693,17 @@ public SSLSocketFactory getSSLSocketFactory (InputStream keyStore, String passwo SSLContext ctx = null; SSLSocketFactory sslSockFactory=null; KeyStore ts; - ts = KeyStore.getInstance("BKS"); + ts = KeyStore.getInstance("BKS"); ts.load(keyStore, password.toCharArray()); TrustManagerFactory tmf = TrustManagerFactory.getInstance("X509"); tmf.init(ts); TrustManager[] tm = tmf.getTrustManagers(); ctx = SSLContext.getInstance("TLSv1"); ctx.init(null, tm, null); - + sslSockFactory=ctx.getSocketFactory(); return sslSockFactory; - + } catch (KeyStoreException | CertificateException | IOException | NoSuchAlgorithmException | KeyManagementException e) { throw new MqttSecurityException(e); } @@ -1713,18 +1713,18 @@ public SSLSocketFactory getSSLSocketFactory (InputStream keyStore, String passwo public void disconnectForcibly() throws MqttException { throw new UnsupportedOperationException(); } - + @Override public void disconnectForcibly(long disconnectTimeout) throws MqttException { throw new UnsupportedOperationException(); } - + @Override public void disconnectForcibly(long quiesceTimeout, long disconnectTimeout) throws MqttException { - throw new UnsupportedOperationException(); + throw new UnsupportedOperationException(); } - + /** * Unregister receiver which receives intent from MqttService avoids * IntentReceiver leaks. @@ -1745,11 +1745,11 @@ public void unregisterResources(){ } } } - + /** * Register receiver to receiver intent from MqttService. Call this method * when activity is hidden and become to show again. - * + * * @param context * - Current activity context. */ diff --git a/paho.mqtt.android.example/build.gradle b/paho.mqtt.android.example/build.gradle index 98424690c..0387cbb33 100644 --- a/paho.mqtt.android.example/build.gradle +++ b/paho.mqtt.android.example/build.gradle @@ -2,12 +2,12 @@ apply plugin: 'com.android.application' android { compileSdkVersion rootProject.ext.compileSdkVersion - buildToolsVersion rootProject.ext.buildToolsVersion +// buildToolsVersion rootProject.ext.buildToolsVersion defaultConfig { applicationId "paho.mqtt.java.example" minSdkVersion 16 - targetSdkVersion 24 + targetSdkVersion 32 versionCode 1 versionName "1.0" } @@ -31,19 +31,19 @@ repositories { dependencies { - compile fileTree(dir: 'libs', excludes: ["org.eclipse.paho.client.mqttv3-${rootProject.ext.clientVersion}.jar"], include: '*.jar') - testCompile 'junit:junit:4.12' - compile "com.android.support:appcompat-v7:${rootProject.ext.supportLibVersion}" - compile "com.android.support:design:${rootProject.ext.supportLibVersion}" - compile "com.android.support:recyclerview-v7:${rootProject.ext.supportLibVersion}" - compile "org.eclipse.paho:org.eclipse.paho.client.mqttv3:${rootProject.ext.clientVersion}" - compile (project(':org.eclipse.paho.android.service')){ + implementation fileTree(dir: 'libs', include: '*.jar') + testImplementation 'junit:junit:4.12' + implementation "com.android.support:appcompat-v7:${rootProject.ext.supportLibVersion}" + implementation "com.android.support:design:${rootProject.ext.supportLibVersion}" + implementation "com.android.support:recyclerview-v7:${rootProject.ext.supportLibVersion}" + implementation "org.eclipse.paho:org.eclipse.paho.client.mqttv3:${rootProject.ext.clientVersion}" + implementation(project(':org.eclipse.paho.android.service')){ //exclude module: "org.eclipse.paho.client.mqttv3" transitive=true } } -configurations.compile.exclude module: 'org.eclipse.paho.client.mqttv3' -task debug << { +//configurations.compile.exclude module: 'org.eclipse.paho.client.mqttv3' +task debug doLast { configurations.compile.each { println it} } diff --git a/paho.mqtt.android.example/src/main/AndroidManifest.xml b/paho.mqtt.android.example/src/main/AndroidManifest.xml index 7c8e3c598..f9afb8f1d 100644 --- a/paho.mqtt.android.example/src/main/AndroidManifest.xml +++ b/paho.mqtt.android.example/src/main/AndroidManifest.xml @@ -12,6 +12,7 @@