diff options
-rw-r--r-- | .travis.yml | 4 | ||||
-rw-r--r-- | build.gradle | 11 | ||||
-rw-r--r-- | src/main/java/eu/siacs/conversations/crypto/axolotl/AxolotlService.java | 11 | ||||
-rw-r--r-- | src/main/java/eu/siacs/conversations/services/XmppConnectionService.java | 1 |
4 files changed, 21 insertions, 6 deletions
diff --git a/.travis.yml b/.travis.yml index e26ccaa42..9d37a4f33 100644 --- a/.travis.yml +++ b/.travis.yml @@ -4,10 +4,6 @@ android: - platform-tools - tools - build-tools-23.0.2 - - build-tools-23.0.1 - - build-tools-23.0.0 - - build-tools-22.0.1 - - build-tools-21.1.2 - build-tools-19.1.0 - android-23 - extra-android-m2repository diff --git a/build.gradle b/build.gradle index 90239457c..74ff02faa 100644 --- a/build.gradle +++ b/build.gradle @@ -54,6 +54,12 @@ dependencies { playstoreCompile 'com.google.android.gms:play-services-gcm:8.4.0' } +ext { + travisBuild = System.getenv("TRAVIS") == "true" + // allows for -Dpre-dex=false to be set + preDexEnabled = "true".equals(System.getProperty("pre-dex", "true")) +} + android { compileSdkVersion 23 buildToolsVersion "23.0.2" @@ -67,6 +73,11 @@ android { applicationId "eu.siacs.conversations" } + dexOptions { + // Skip pre-dexing when running on Travis CI or when disabled via -Dpre-dex=false. + preDexLibraries = preDexEnabled && !travisBuild + } + compileOptions { sourceCompatibility JavaVersion.VERSION_1_7 targetCompatibility JavaVersion.VERSION_1_7 diff --git a/src/main/java/eu/siacs/conversations/crypto/axolotl/AxolotlService.java b/src/main/java/eu/siacs/conversations/crypto/axolotl/AxolotlService.java index cc5c2491b..a24e45308 100644 --- a/src/main/java/eu/siacs/conversations/crypto/axolotl/AxolotlService.java +++ b/src/main/java/eu/siacs/conversations/crypto/axolotl/AxolotlService.java @@ -314,6 +314,11 @@ public class AxolotlService implements OnAdvancedStreamFeaturesLoaded { return this.pepBroken; } + public void resetBrokenness() { + this.pepBroken = false; + numPublishTriesOnEmptyPep = 0; + } + public void regenerateKeys(boolean wipeOther) { axolotlStore.regenerate(); sessions.clear(); @@ -448,7 +453,8 @@ public class AxolotlService implements OnAdvancedStreamFeaturesLoaded { mXmppConnectionService.sendIqPacket(account, publish, new OnIqPacketReceived() { @Override public void onIqPacketReceived(Account account, IqPacket packet) { - if (packet.getType() != IqPacket.TYPE.RESULT) { + if (packet.getType() == IqPacket.TYPE.ERROR) { + pepBroken = true; Log.d(Config.LOGTAG, getLogprefix(account) + "Error received while publishing own device id" + packet.findChild("error")); } } @@ -612,7 +618,8 @@ public class AxolotlService implements OnAdvancedStreamFeaturesLoaded { Log.d(Config.LOGTAG, getLogprefix(account) + "Announcing device " + getOwnDeviceId()); publishOwnDeviceIdIfNeeded(); } - } else { + } else if (packet.getType() == IqPacket.TYPE.ERROR) { + pepBroken = true; Log.d(Config.LOGTAG, getLogprefix(account) + "Error received while publishing bundle: " + packet.findChild("error")); } } diff --git a/src/main/java/eu/siacs/conversations/services/XmppConnectionService.java b/src/main/java/eu/siacs/conversations/services/XmppConnectionService.java index 669178324..878b4334f 100644 --- a/src/main/java/eu/siacs/conversations/services/XmppConnectionService.java +++ b/src/main/java/eu/siacs/conversations/services/XmppConnectionService.java @@ -2581,6 +2581,7 @@ public class XmppConnectionService extends Service implements OnPhoneContactsLoa disconnect(account, force); account.getRoster().clearPresences(); connection.resetEverything(); + account.getAxolotlService().resetBrokenness(); } } } |