fix changes and make OTR working again

This commit is contained in:
Christian Schneppe 2020-04-29 20:25:31 +02:00
parent 325487f82f
commit ace3b117b7
No known key found for this signature in database
GPG key ID: F30B8D686B44D87E
33 changed files with 319 additions and 131 deletions

74
.circleci/config.yml Normal file
View file

@ -0,0 +1,74 @@
version: 2
jobs:
test:
docker:
- image: registry.gitlab.com/fdroid/ci-images-client:latest
steps:
- checkout
- restore_cache:
key: gradle-{{ checksum "build.gradle" }}-{{ checksum ".circleci/config.yml" }}
- run: export GRADLE_USER_HOME=$PWD/.gradle
- run: echo y | sdkmanager "platforms;android-$(sed -n 's,.*compileSdkVersion\s*\([0-9][0-9]*\).*,\1,p' build.gradle)" > /dev/null
- run: ./gradlew lintGitDebug
- save_cache:
paths:
- .gradle/caches
- .gradle/wrapper
key: gradle-{{ checksum "build.gradle" }}-{{ checksum ".circleci/config.yml" }}
- store_artifacts:
path: build/outputs/apk/standard
destination: apk
build:
docker:
- image: registry.gitlab.com/fdroid/ci-images-client:latest
steps:
- checkout
- restore_cache:
key: android
- run: export GRADLE_USER_HOME=$PWD/.gradle
- run: echo y | sdkmanager "platforms;android-$(sed -n 's,.*compileSdkVersion\s*\([0-9][0-9]*\).*,\1,p' build.gradle)" > /dev/null
# build
- run: ./gradlew assembleGit
- save_cache:
paths:
- ~/.android
key: android
- store_artifacts:
path: build/outputs/apk/git
publish:
docker:
- image: registry.gitlab.com/fdroid/ci-images-client:latest
steps:
- checkout
- restore_cache:
key: android
- run: export GRADLE_USER_HOME=$PWD/.gradle
- run: echo y | sdkmanager "platforms;android-$(sed -n 's,.*compileSdkVersion\s*\([0-9][0-9]*\).*,\1,p' build.gradle)" > /dev/null
# workaround for fdroid nightly circleci bug
- run: sed -i "s/os.getenv('CIRCLE_REPOSITORY_URL')/\"https:\/\/github.com\/kriztan\/Pix-Art-Messenger\"/" /usr/lib/python3/dist-packages/fdroidserver/nightly.py
# generate version number
- run: sed -i "s/^\(\s*versionCode\s*\).*$/\1$(git rev-list --first-parent --count HEAD)/" build.gradle
- run: sed -i "0,/versionName/s/^\(\s*versionName\).*/\1 \"$(printf '%s-%05d' $(git describe --tag --abbrev=0) $(git rev-list --first-parent --count HEAD))\"/" build.gradle
- run: cat -n build.gradle
# build
- run: ./gradlew assembleGit
# publish on nightly fdroid repo
- run: fdroid nightly
- save_cache:
paths:
- ~/.android
key: android
workflows:
version: 2
test_build:
jobs:
- build:
filters:
branches:
ignore: master
- publish:
filters:
branches:
only: master

View file

@ -1,19 +0,0 @@
language: android
jdk:
- oraclejdk8
android:
components:
- platform-tools
- tools
- build-tools-28.0.3
- extra-google-google_play_services
licenses:
- '.+'
before_script:
- wget -O libs/libwebrtc-m81.aar http://gultsch.de/files/libwebrtc-m81.aar
script:
- ./gradlew assembleConversationsFreeSystemRelease
- ./gradlew assembleQuicksyFreeCompatRelease
before_install:
- yes | sdkmanager "platforms;android-28"

View file

@ -2,11 +2,11 @@
// sub-projects/modules.
buildscript {
repositories {
jcenter()
google()
jcenter()
}
dependencies {
classpath 'com.android.tools.build:gradle:3.6.1'
classpath 'com.android.tools.build:gradle:3.6.2'
}
}
@ -90,11 +90,13 @@ dependencies {
implementation 'com.squareup.retrofit2:converter-gson:2.6.4'
implementation 'com.google.guava:guava:28.2-android'
implementation 'com.github.AppIntro:AppIntro:5.1.0'
implementation fileTree(include: ['libwebrtc-m81.aar'], dir: 'libs')
}
ext {
travisBuild = System.getenv("TRAVIS") == "true"
preDexEnabled = System.getProperty("pre-dex", "true")
abiCodes = ['armeabi-v7a': 1, 'x86': 2, 'x86_64': 3, 'arm64-v8a': 4]
}
android {
@ -124,6 +126,13 @@ android {
resValue "string", "app_name", "Pix-Art Messenger"
}
splits {
abi {
universalApk true
enable true
}
}
dataBinding {
enabled true
}

View file

@ -1 +0,0 @@
* Audio/Video calls (Requires server support in form of STUN and TURN servers discoverable via XEP-0215)

View file

@ -2,5 +2,3 @@ android.enableJetifier=true
android.useAndroidX=true
org.gradle.jvmargs=-Xmx2048M
org.gradle.parallel=true
android.enableR8=true
android.enableR8.fullMode=false

BIN
libs/libwebrtc-m81.aar Normal file

Binary file not shown.

View file

@ -70,10 +70,6 @@ public class Conversation extends AbstractEntity implements Blockable, Comparabl
private static final String ATTRIBUTE_CRYPTO_TARGETS = "crypto_targets";
private static final String ATTRIBUTE_NEXT_ENCRYPTION = "next_encryption";
private static final String ATTRIBUTE_CORRECTING_MESSAGE = "correcting_message";
static final String ATTRIBUTE_MEMBERS_ONLY = "members_only";
static final String ATTRIBUTE_MODERATED = "moderated";
static final String ATTRIBUTE_NON_ANONYMOUS = "non_anonymous";
public static final String ATTRIBUTE_FORMERLY_PRIVATE_NON_ANONYMOUS = "formerly_private_non_anonymous";
protected final ArrayList<Message> messages = new ArrayList<>();
public AtomicBoolean messagesLoaded = new AtomicBoolean(true);
protected Account account = null;
@ -148,7 +144,7 @@ public class Conversation extends AbstractEntity implements Blockable, Comparabl
return null;
}
private static boolean suitableForOmemoByDefault(final Conversation conversation) {
public static boolean suitableForOmemoByDefault(final Conversation conversation) {
if (conversation.getJid().asBareJid().equals(Config.BUG_REPORTS)) {
return false;
}
@ -594,17 +590,6 @@ public class Conversation extends AbstractEntity implements Blockable, Comparabl
return unread;
}
public static Message getLatestMarkableMessage(final List<Message> messages, boolean isPrivateAndNonAnonymousMuc) {
for (int i = messages.size() - 1; i >= 0; --i) {
final Message message = messages.get(i);
if (message.getStatus() <= Message.STATUS_RECEIVED
&& (message.markable || isPrivateAndNonAnonymousMuc)
&& !message.isPrivateMessage()) {
return message;
}
}
return null;
}
public Message getLatestMessage() {
synchronized (this.messages) {
if (this.messages.size() == 0) {
@ -869,21 +854,6 @@ public class Conversation extends AbstractEntity implements Blockable, Comparabl
}
}
public static boolean suitableForOmemoByDefault(final Conversation conversation) {
if (conversation.getJid().asBareJid().equals(Config.BUG_REPORTS)) {
return false;
}
if (conversation.getContact().isOwnServer()) {
return false;
}
final String contact = conversation.getJid().getDomain();
final String account = conversation.getAccount().getServer();
if (Config.OMEMO_EXCEPTIONS.CONTACT_DOMAINS.contains(contact) || Config.OMEMO_EXCEPTIONS.ACCOUNT_DOMAINS.contains(account)) {
return false;
}
return conversation.isSingleOrPrivateAndNonAnonymous() || conversation.getBooleanAttribute(ATTRIBUTE_FORMERLY_PRIVATE_NON_ANONYMOUS, false);
}
public boolean setNextEncryption(int encryption) {
return this.setAttribute(ATTRIBUTE_NEXT_ENCRYPTION, encryption);
}

View file

@ -144,18 +144,19 @@ public class Message extends AbstractEntity implements AvatarService.Avatarable
TYPE_TEXT,
false,
null,
null,
null,
null,
true,
null,
false,
null,
null,
false,
false,
null);
}
null,
null,
null,
true,
false,
null,
false,
null,
null,
false,
false,
null);
}
public Message(Conversation conversation, int status, int type, final String remoteMsgId) {
this(conversation, java.util.UUID.randomUUID().toString(),

View file

@ -1,8 +1,7 @@
package eu.siacs.conversations.entities;
import android.support.annotation.DrawableRes;
import com.google.common.base.Strings;
import androidx.annotation.DrawableRes;
import eu.siacs.conversations.R;

View file

@ -66,9 +66,7 @@ public abstract class AbstractGenerator {
Namespace.JINGLE_APPS_RTP,
Namespace.JINGLE_APPS_DTLS,
Namespace.JINGLE_MESSAGE
};
private static final SimpleDateFormat DATE_FORMAT = new SimpleDateFormat("yyyy-MM-dd'T'HH:mm:ss.SSS'Z'", Locale.US);
};
protected XmppConnectionService mXmppConnectionService;
private String mVersion = null;
@ -122,10 +120,6 @@ public abstract class AbstractGenerator {
return Base64.encodeToString(sha1, Base64.NO_WRAP);
}
public static String getTimestamp(long time) {
DATE_FORMAT.setTimeZone(TimeZone.getTimeZone("UTC"));
return DATE_FORMAT.format(time);
}
public List<String> getFeatures(Account account) {
final XmppConnection connection = account.getXmppConnection();
final ArrayList<String> features = new ArrayList<>(Arrays.asList(FEATURES));

View file

@ -403,6 +403,11 @@ public class MessageParser extends AbstractParser implements OnMessagePacketRece
final Jid from = packet.getFrom();
final String id = packet.getId();
if (from != null && id != null) {
final Message message = mXmppConnectionService.markMessage(account,
from.asBareJid(),
packet.getId(),
Message.STATUS_SEND_FAILED,
extractErrorMessage(packet));
if (id.startsWith(JingleRtpConnection.JINGLE_MESSAGE_PROPOSE_ID_PREFIX)) {
final String sessionId = id.substring(JingleRtpConnection.JINGLE_MESSAGE_PROPOSE_ID_PREFIX.length());
mXmppConnectionService.getJingleConnectionManager()

View file

@ -20,9 +20,10 @@ import android.media.AudioManager;
import android.media.AudioRecord;
import android.media.MediaRecorder;
import android.os.Build;
import android.support.annotation.Nullable;
import android.util.Log;
import androidx.annotation.Nullable;
import org.webrtc.ThreadUtils;
import java.util.Collections;

View file

@ -23,7 +23,7 @@ import android.media.AudioManager;
import android.os.Handler;
import android.os.Looper;
import android.os.Process;
import android.support.annotation.Nullable;
import androidx.annotation.Nullable;
import android.util.Log;
import java.util.List;

View file

@ -15,7 +15,7 @@ import android.hardware.SensorEvent;
import android.hardware.SensorEventListener;
import android.hardware.SensorManager;
import android.os.Build;
import android.support.annotation.Nullable;
import androidx.annotation.Nullable;
import android.util.Log;
import org.webrtc.ThreadUtils;

View file

@ -117,14 +117,6 @@ public class NotificationService {
return Pattern.compile("(?<=(^|\\s))" + Pattern.quote(nick) + "(?=\\s|$|\\p{Punct})");
}
private static boolean isImageMessage(Message message) {
return message.getType() != Message.TYPE_TEXT
&& message.getTransferable() == null
&& !message.isDeleted()
&& message.getEncryption() != Message.ENCRYPTION_PGP
&& message.getFileParams().height > 0;
}
@RequiresApi(api = Build.VERSION_CODES.O)
void initializeChannels() {
final Context c = mXmppConnectionService;
@ -1187,8 +1179,6 @@ public class NotificationService {
notify(FOREGROUND_NOTIFICATION_ID, notification);
}
}
Notification AppUpdateNotification(PendingIntent intent, String version, String filesize) {
Notification.Builder mBuilder = new Notification.Builder(mXmppConnectionService);
mBuilder.setContentTitle(mXmppConnectionService.getString(R.string.app_name));
@ -1204,6 +1194,8 @@ public class NotificationService {
public void AppUpdateServiceNotification(Notification notification) {
notify(FOREGROUND_NOTIFICATION_ID, notification);
}
private void notify(String tag, int id, Notification notification) {
final NotificationManagerCompat notificationManager = NotificationManagerCompat.from(mXmppConnectionService);
try {

View file

@ -40,11 +40,11 @@ import android.util.LruCache;
import android.util.Pair;
import androidx.annotation.BoolRes;
import com.google.common.base.Objects;
import androidx.annotation.IntegerRes;
import androidx.core.app.RemoteInput;
import androidx.core.content.ContextCompat;
import com.google.common.base.Objects;
import com.google.common.base.Strings;
import net.java.otr4j.OtrException;
@ -158,8 +158,8 @@ import eu.siacs.conversations.xmpp.Patches;
import eu.siacs.conversations.xmpp.XmppConnection;
import eu.siacs.conversations.xmpp.chatstate.ChatState;
import eu.siacs.conversations.xmpp.forms.Data;
import eu.siacs.conversations.xmpp.jingle.AbstractJingleConnection;
import eu.siacs.conversations.xmpp.jid.OtrJidHelper;
import eu.siacs.conversations.xmpp.jingle.AbstractJingleConnection;
import eu.siacs.conversations.xmpp.jingle.JingleConnectionManager;
import eu.siacs.conversations.xmpp.jingle.Media;
import eu.siacs.conversations.xmpp.jingle.RtpEndUserState;
@ -1672,7 +1672,7 @@ public class XmppConnectionService extends Service {
break;
}
if (message.needsUploading()) {
mJingleConnectionManager.createNewConnection(message);
mJingleConnectionManager.startJingleFileTransfer(message);
} else {
packet = mMessageGenerator.generateOtrChat(message);
}
@ -3656,7 +3656,7 @@ public class XmppConnectionService extends Service {
return;
}
if (message.needsUploading()) {
mJingleConnectionManager.createNewConnection(message);
mJingleConnectionManager.startJingleFileTransfer(message);
} else {
MessagePacket outPacket = mMessageGenerator.generateOtrChat(message);
if (outPacket != null) {

View file

@ -52,8 +52,6 @@ import android.widget.ListView;
import android.widget.TextView.OnEditorActionListener;
import android.widget.Toast;
import com.google.common.base.Optional;
import androidx.annotation.IdRes;
import androidx.annotation.NonNull;
import androidx.annotation.Nullable;
@ -67,6 +65,8 @@ import androidx.core.view.inputmethod.InputConnectionCompat;
import androidx.core.view.inputmethod.InputContentInfoCompat;
import androidx.databinding.DataBindingUtil;
import com.google.common.base.Optional;
import net.java.otr4j.session.SessionStatus;
import java.util.ArrayList;
@ -99,7 +99,6 @@ import eu.siacs.conversations.entities.Transferable;
import eu.siacs.conversations.entities.TransferablePlaceholder;
import eu.siacs.conversations.http.HttpDownloadConnection;
import eu.siacs.conversations.persistance.FileBackend;
import eu.siacs.conversations.services.AppRTCAudioManager;
import eu.siacs.conversations.services.MessageArchiveService;
import eu.siacs.conversations.services.XmppConnectionService;
import eu.siacs.conversations.ui.adapter.MediaPreviewAdapter;
@ -127,7 +126,6 @@ import eu.siacs.conversations.utils.MenuDoubleTabUtil;
import eu.siacs.conversations.utils.MessageUtils;
import eu.siacs.conversations.utils.NickValidityChecker;
import eu.siacs.conversations.utils.Patterns;
import eu.siacs.conversations.utils.PermissionUtils;
import eu.siacs.conversations.utils.QuickLoader;
import eu.siacs.conversations.utils.StylingHelper;
import eu.siacs.conversations.utils.UIHelper;
@ -135,11 +133,11 @@ import eu.siacs.conversations.xmpp.XmppConnection;
import eu.siacs.conversations.xmpp.chatstate.ChatState;
import eu.siacs.conversations.xmpp.jingle.AbstractJingleConnection;
import eu.siacs.conversations.xmpp.jingle.JingleConnectionManager;
import me.drakeet.support.toast.ToastCompat;
import eu.siacs.conversations.xmpp.jingle.JingleFileTransferConnection;
import eu.siacs.conversations.xmpp.jingle.Media;
import eu.siacs.conversations.xmpp.jingle.OngoingRtpSession;
import eu.siacs.conversations.xmpp.jingle.RtpCapability;
import me.drakeet.support.toast.ToastCompat;
import rocks.xmpp.addr.Jid;
import static eu.siacs.conversations.entities.Message.DELETED_MESSAGE_BODY;
@ -1159,18 +1157,23 @@ public class ConversationFragment extends XmppFragment implements EditMessage.Ke
menuCall.setVisible(rtpCapability != RtpCapability.Capability.NONE);
menuVideoCall.setVisible(rtpCapability == RtpCapability.Capability.VIDEO);
}
menuInviteContact.setVisible(false);
menuArchiveChat.setTitle(R.string.action_end_conversation);
menuInviteContact.setVisible(false);
menuArchiveChat.setTitle(R.string.action_end_conversation);
}
Fragment secondaryFragment = activity.getFragmentManager().findFragmentById(R.id.secondary_fragment);
if (secondaryFragment instanceof ConversationFragment) {
if (conversation.getMode() == Conversation.MODE_MULTI) {
menuGroupDetails.setTitle(conversation.getMucOptions().isPrivateAndNonAnonymous() ? R.string.action_group_details : R.string.channel_details);
menuGroupDetails.setVisible(true);
menuContactDetails.setVisible(false);
} else {
menuGroupDetails.setVisible(false);
menuContactDetails.setVisible(!this.conversation.withSelf());
}
} else {
menuGroupDetails.setVisible(false);
menuContactDetails.setVisible(false);
}
menuMediaBrowser.setVisible(true);
menuNeedHelp.setVisible(true);
menuSearchUpdates.setVisible(false);
ConversationMenuConfigurator.configureAttachmentMenu(conversation, menu, activity.xmppConnectionService.getAttachmentChoicePreference(), hasAttachments);
ConversationMenuConfigurator.configureEncryptionMenu(conversation, menu, activity);
} else {
menuNeedHelp.setVisible(false);
menuSearchUpdates.setVisible(true);
menuInviteContact.setVisible(false);

View file

@ -6,20 +6,21 @@ import android.app.PictureInPictureParams;
import android.content.Context;
import android.content.Intent;
import android.content.pm.PackageManager;
import android.databinding.DataBindingUtil;
import android.os.Build;
import android.os.Bundle;
import android.os.PowerManager;
import android.os.SystemClock;
import android.support.annotation.NonNull;
import android.support.annotation.RequiresApi;
import android.support.annotation.StringRes;
import android.util.Log;
import android.util.Rational;
import android.view.View;
import android.view.WindowManager;
import android.widget.Toast;
import androidx.annotation.NonNull;
import androidx.annotation.RequiresApi;
import androidx.annotation.StringRes;
import androidx.databinding.DataBindingUtil;
import com.google.common.base.Optional;
import com.google.common.base.Preconditions;
import com.google.common.base.Throwables;

View file

@ -80,6 +80,7 @@ import eu.siacs.conversations.entities.Presences;
import eu.siacs.conversations.services.AvatarService;
import eu.siacs.conversations.services.BarcodeProvider;
import eu.siacs.conversations.services.EmojiService;
import eu.siacs.conversations.services.QuickConversationsService;
import eu.siacs.conversations.services.UpdateService;
import eu.siacs.conversations.services.XmppConnectionService;
import eu.siacs.conversations.services.XmppConnectionService.XmppConnectionBinder;
@ -97,8 +98,8 @@ import me.drakeet.support.toast.ToastCompat;
import pl.droidsonroids.gif.GifDrawable;
import rocks.xmpp.addr.Jid;
import static eu.siacs.conversations.ui.SettingsActivity.USE_BUNDLED_EMOJIS;
import static eu.siacs.conversations.ui.SettingsActivity.ENABLE_OTR_ENCRYPTION;
import static eu.siacs.conversations.ui.SettingsActivity.USE_BUNDLED_EMOJIS;
import static eu.siacs.conversations.ui.SettingsActivity.USE_INTERNAL_UPDATER;
public abstract class XmppActivity extends ActionBarActivity {
@ -126,6 +127,7 @@ public abstract class XmppActivity extends ActionBarActivity {
protected int mTheme;
protected boolean mUsingEnterKey = false;
protected boolean mUseTor = false;
protected Toast mToast;
protected Runnable onOpenPGPKeyPublished = () -> ToastCompat.makeText(XmppActivity.this, R.string.openpgp_has_been_published, Toast.LENGTH_SHORT).show();

View file

@ -35,8 +35,8 @@ public class Compatibility {
"notification_headsup",
"vibrate_on_notification",
"call_ringtone"
private static final List<String> UNUSED_SETTINGS_PRE_TWENTYSIX = Collections.singletonList("more_notification_settings");
);
private static final List<String> UNUSED_SETTINGS_PRE_TWENTYSIX = Collections.singletonList("more_notification_settings");
private static final List<String> UNUESD_SETTINGS_PRE_TWENTYSIX = Arrays.asList(
"message_notification_settings",
"call_notification_settings"

View file

@ -20,6 +20,7 @@ import java.text.SimpleDateFormat;
import java.util.Date;
import java.util.Locale;
import eu.siacs.conversations.BuildConfig;
import eu.siacs.conversations.Config;
import eu.siacs.conversations.R;
import eu.siacs.conversations.entities.Account;
@ -68,7 +69,7 @@ public class ExceptionHelper {
report.append("Device: ").append(deviceName).append('\n');
report.append("Android SDK: ").append(sdkVersion).append(" (").append(release).append(")").append('\n');
report.append("Version: ").append(packageInfo.versionName).append('\n');
report.append(String.format(Locale.ROOT, "Version: %s(%d)", versionName, version)).append('\n');
report.append(String.format(Locale.ROOT, "Version: %s(%d)", BuildConfig.VERSION_NAME, BuildConfig.VERSION_CODE)).append('\n');
report.append("Last Update: ").append(DATE_FORMAT.format(new Date(packageInfo.lastUpdateTime))).append('\n');
Signature[] signatures = packageInfo.signatures;
if (signatures != null && signatures.length >= 1) {

View file

@ -1,6 +1,9 @@
package eu.siacs.conversations.utils;
public final class Namespace {
public static final String DISCO_ITEMS = "http://jabber.org/protocol/disco#items";
public static final String DISCO_INFO = "http://jabber.org/protocol/disco#info";
public static final String EXTERNAL_SERVICE_DISCOVERY = "urn:xmpp:extdisco:2";
public static final String BLOCKING = "urn:xmpp:blocking";
public static final String ROSTER = "jabber:iq:roster";
public static final String REGISTER = "jabber:iq:register";
@ -25,18 +28,28 @@ public final class Namespace {
public static final String BOOKMARKS = "storage:bookmarks";
public static final String SYNCHRONIZATION = "im.quicksy.synchronization:0";
public static final String AVATAR_CONVERSION = "urn:xmpp:pep-vcard-conversion:0";
public static final String JINGLE = "urn:xmpp:jingle:1";
public static final String JINGLE_MESSAGE = "urn:xmpp:jingle-message:0";
public static final String JINGLE_ENCRYPTED_TRANSPORT = "urn:xmpp:jingle:jet:0";
public static final String JINGLE_ENCRYPTED_TRANSPORT_OMEMO = "urn:xmpp:jingle:jet-omemo:0";
public static final String JINGLE_TRANSPORTS_S5B = "urn:xmpp:jingle:transports:s5b:1";
public static final String JINGLE_TRANSPORTS_IBB = "urn:xmpp:jingle:transports:ibb:1";
public static final String JINGLE_TRANSPORT_ICE_UDP = "urn:xmpp:jingle:transports:ice-udp:1";
public static final String JINGLE_APPS_RTP = "urn:xmpp:jingle:apps:rtp:1";
public static final String JINGLE_APPS_DTLS = "urn:xmpp:jingle:apps:dtls:0";
public static final String JINGLE_APPS_GROUPING = "urn:xmpp:jingle:apps:grouping:0";
public static final String JINGLE_FEATURE_AUDIO = "urn:xmpp:jingle:apps:rtp:audio";
public static final String JINGLE_FEATURE_VIDEO = "urn:xmpp:jingle:apps:rtp:video";
public static final String JINGLE_RTP_HEADER_EXTENSIONS = "urn:xmpp:jingle:apps:rtp:rtp-hdrext:0";
public static final String JINGLE_RTP_FEEDBACK_NEGOTIATION = "urn:xmpp:jingle:apps:rtp:rtcp-fb:0";
public static final String JINGLE_RTP_SOURCE_SPECIFIC_MEDIA_ATTRIBUTES = "urn:xmpp:jingle:apps:rtp:ssma:0";
public static final String IBB = "http://jabber.org/protocol/ibb";
public static final String PING = "urn:xmpp:ping";
public static final String PUSH = "urn:xmpp:push:0";
public static final String COMMANDS = "http://jabber.org/protocol/commands";
public static final String JINGLE_ENCRYPTED_TRANSPORT = "urn:xmpp:jingle:jet:0";
public static final String JINGLE_ENCRYPTED_TRANSPORT_OMEMO = "urn:xmpp:jingle:jet-omemo:0";
public static final String MUC_USER = "http://jabber.org/protocol/muc#user";
public static final String BOOKMARKS2 = "urn:xmpp:bookmarks:0";
public static final String BOOKMARKS2_COMPAT = BOOKMARKS2 + "#compat";
public static final String DISCO_ITEMS = "http://jabber.org/protocol/disco#items";
public static final String DISCO_INFO = "http://jabber.org/protocol/disco#info";
public static final String INVITE = "urn:xmpp:invite";
public static final String PARS = "urn:xmpp:pars:0";
}

View file

@ -4,7 +4,8 @@ import android.Manifest;
import android.app.Activity;
import android.content.pm.PackageManager;
import android.os.Build;
import android.support.v4.app.ActivityCompat;
import androidx.core.app.ActivityCompat;
import com.google.common.collect.ImmutableList;

View file

@ -0,0 +1,55 @@
package eu.siacs.conversations.xml;
public final class Namespace {
public static final String DISCO_ITEMS = "http://jabber.org/protocol/disco#items";
public static final String DISCO_INFO = "http://jabber.org/protocol/disco#info";
public static final String EXTERNAL_SERVICE_DISCOVERY = "urn:xmpp:extdisco:2";
public static final String BLOCKING = "urn:xmpp:blocking";
public static final String ROSTER = "jabber:iq:roster";
public static final String REGISTER = "jabber:iq:register";
public static final String BYTE_STREAMS = "http://jabber.org/protocol/bytestreams";
public static final String HTTP_UPLOAD = "urn:xmpp:http:upload:0";
public static final String HTTP_UPLOAD_LEGACY = "urn:xmpp:http:upload";
public static final String STANZA_IDS = "urn:xmpp:sid:0";
public static final String IDLE = "urn:xmpp:idle:1";
public static final String DATA = "jabber:x:data";
public static final String OOB = "jabber:x:oob";
public static final String SASL = "urn:ietf:params:xml:ns:xmpp-sasl";
public static final String TLS = "urn:ietf:params:xml:ns:xmpp-tls";
public static final String PUBSUB = "http://jabber.org/protocol/pubsub";
public static final String PUBSUB_PUBLISH_OPTIONS = PUBSUB + "#publish-options";
public static final String PUBSUB_ERROR = PUBSUB + "#errors";
public static final String PUBSUB_OWNER = PUBSUB + "#owner";
public static final String NICK = "http://jabber.org/protocol/nick";
public static final String FLEXIBLE_OFFLINE_MESSAGE_RETRIEVAL = "http://jabber.org/protocol/offline";
public static final String BIND = "urn:ietf:params:xml:ns:xmpp-bind";
public static final String P1_S3_FILE_TRANSFER = "p1:s3filetransfer";
public static final String BOOKMARKS_CONVERSION = "urn:xmpp:bookmarks-conversion:0";
public static final String BOOKMARKS = "storage:bookmarks";
public static final String SYNCHRONIZATION = "im.quicksy.synchronization:0";
public static final String AVATAR_CONVERSION = "urn:xmpp:pep-vcard-conversion:0";
public static final String JINGLE = "urn:xmpp:jingle:1";
public static final String JINGLE_MESSAGE = "urn:xmpp:jingle-message:0";
public static final String JINGLE_ENCRYPTED_TRANSPORT = "urn:xmpp:jingle:jet:0";
public static final String JINGLE_ENCRYPTED_TRANSPORT_OMEMO = "urn:xmpp:jingle:jet-omemo:0";
public static final String JINGLE_TRANSPORTS_S5B = "urn:xmpp:jingle:transports:s5b:1";
public static final String JINGLE_TRANSPORTS_IBB = "urn:xmpp:jingle:transports:ibb:1";
public static final String JINGLE_TRANSPORT_ICE_UDP = "urn:xmpp:jingle:transports:ice-udp:1";
public static final String JINGLE_APPS_RTP = "urn:xmpp:jingle:apps:rtp:1";
public static final String JINGLE_APPS_DTLS = "urn:xmpp:jingle:apps:dtls:0";
public static final String JINGLE_APPS_GROUPING = "urn:xmpp:jingle:apps:grouping:0";
public static final String JINGLE_FEATURE_AUDIO = "urn:xmpp:jingle:apps:rtp:audio";
public static final String JINGLE_FEATURE_VIDEO = "urn:xmpp:jingle:apps:rtp:video";
public static final String JINGLE_RTP_HEADER_EXTENSIONS = "urn:xmpp:jingle:apps:rtp:rtp-hdrext:0";
public static final String JINGLE_RTP_FEEDBACK_NEGOTIATION = "urn:xmpp:jingle:apps:rtp:rtcp-fb:0";
public static final String JINGLE_RTP_SOURCE_SPECIFIC_MEDIA_ATTRIBUTES = "urn:xmpp:jingle:apps:rtp:ssma:0";
public static final String IBB = "http://jabber.org/protocol/ibb";
public static final String PING = "urn:xmpp:ping";
public static final String PUSH = "urn:xmpp:push:0";
public static final String COMMANDS = "http://jabber.org/protocol/commands";
public static final String MUC_USER = "http://jabber.org/protocol/muc#user";
public static final String BOOKMARKS2 = "urn:xmpp:bookmarks:0";
public static final String BOOKMARKS2_COMPAT = BOOKMARKS2 + "#compat";
public static final String INVITE = "urn:xmpp:invite";
public static final String PARS = "urn:xmpp:pars:0";
}

View file

@ -1,6 +1,6 @@
package eu.siacs.conversations.xmpp.jingle.stanzas;
import android.support.annotation.NonNull;
import androidx.annotation.NonNull;
import com.google.common.base.Preconditions;

View file

@ -1,6 +1,6 @@
package eu.siacs.conversations.xmpp.jingle.stanzas;
import android.support.annotation.NonNull;
import androidx.annotation.NonNull;
import com.google.common.base.CaseFormat;
import com.google.common.base.Preconditions;

View file

@ -1,6 +1,6 @@
package eu.siacs.conversations.xmpp.jingle.stanzas;
import android.support.annotation.NonNull;
import androidx.annotation.NonNull;
import com.google.common.base.CaseFormat;

View file

@ -34,13 +34,13 @@
android:visibility="gone" />
</LinearLayout>
<android.support.design.widget.AppBarLayout
<com.google.android.material.appbar.AppBarLayout
android:id="@+id/app_bar_layout"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:visibility="visible">
<android.support.v7.widget.Toolbar
<androidx.appcompat.widget.Toolbar
android:id="@+id/toolbar"
android:layout_width="match_parent"
android:layout_height="?attr/actionBarSize"
@ -60,7 +60,7 @@
android:textColor="@color/white"
tools:text="Juliet Capulet" />
</android.support.design.widget.AppBarLayout>
</com.google.android.material.appbar.AppBarLayout>
<LinearLayout
android:layout_width="match_parent"
@ -128,7 +128,7 @@
android:layout_height="wrap_content"
android:layout_centerInParent="true">
<android.support.design.widget.FloatingActionButton
<com.google.android.material.floatingactionbutton.FloatingActionButton
android:id="@+id/reject_call"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
@ -143,7 +143,7 @@
app:maxImageSize="36dp"
tools:visibility="visible" />
<android.support.design.widget.FloatingActionButton
<com.google.android.material.floatingactionbutton.FloatingActionButton
android:id="@+id/accept_call"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
@ -153,7 +153,7 @@
android:layout_margin="16dp"
android:src="@drawable/ic_call_white_48dp"
android:visibility="gone"
app:backgroundTint="@color/green700"
app:backgroundTint="@color/green500"
app:elevation="4dp"
app:fabCustomSize="72dp"
app:maxImageSize="36dp"
@ -175,7 +175,7 @@
app:fabSize="mini"
app:tint="?attr/icon_tint" />
<android.support.design.widget.FloatingActionButton
<com.google.android.material.floatingactionbutton.FloatingActionButton
android:id="@+id/end_call"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
@ -188,7 +188,7 @@
app:fabCustomSize="72dp"
app:maxImageSize="36dp" />
<android.support.design.widget.FloatingActionButton
<com.google.android.material.floatingactionbutton.FloatingActionButton
android:id="@+id/in_call_action_right"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
@ -202,7 +202,7 @@
app:fabSize="mini"
app:tint="?attr/icon_tint" />
<android.support.design.widget.FloatingActionButton
<com.google.android.material.floatingactionbutton.FloatingActionButton
android:id="@+id/in_call_action_far_right"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
@ -211,7 +211,7 @@
android:layout_toEndOf="@+id/in_call_action_right"
android:layout_toRightOf="@+id/in_call_action_right"
android:visibility="gone"
app:backgroundTint="?color_background_primary"
app:backgroundTint="@color/green500"
app:elevation="4dp"
app:fabSize="mini"
app:tint="?attr/icon_tint" />

View file

@ -0,0 +1,47 @@
<?xml version="1.0" encoding="utf-8"?>
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:background="?android:attr/activatedBackgroundIndicator"
android:padding="12dp"
android:id="@+id/presence_template">
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:minHeight="48dp"
android:orientation="vertical"
android:layout_centerVertical="true"
android:layout_alignParentLeft="true"
android:layout_alignParentStart="true"
android:layout_toLeftOf="@+id/delete_button"
android:layout_toStartOf="@+id/delete_button"
android:layout_marginRight="8dp">
<TextView
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:id="@+id/presence_status_message"
android:textAppearance="@style/TextAppearance.Conversations.Body1"/>
<TextView
android:id="@+id/status"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:paddingBottom="1dp"
android:paddingLeft="4dp"
android:paddingRight="4dp"
android:paddingTop="1dp"
android:textAllCaps="true"
android:textAppearance="@style/TextAppearance.Conversations.Tag"
android:layout_marginTop="4dp"/>
</LinearLayout>
<ImageButton
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:id="@+id/delete_button"
android:layout_centerVertical="true"
android:layout_alignParentRight="true"
android:layout_alignParentEnd="true"
android:background="?attr/selectableItemBackgroundBorderless"
android:padding="@dimen/image_button_padding"
android:alpha="?attr/icon_alpha"
android:src="?attr/icon_remove"/>
</RelativeLayout>

View file

@ -1,4 +1,5 @@
<resources>
<dimen name="publish_avatar_top_margin">16dp</dimen>
<dimen name="incoming_call_radius">64dp</dimen>
<dimen name="publish_avatar_size">128dp</dimen>
</resources>

View file

@ -1,4 +1,5 @@
<resources>
<dimen name="publish_avatar_top_margin">24dp</dimen>
<dimen name="incoming_call_radius">96dp</dimen>
<dimen name="publish_avatar_size">192dp</dimen>
</resources>

View file

@ -18,6 +18,7 @@
<dimen name="toolbar_elevation">4dp</dimen>
<dimen name="publish_avatar_top_margin">8dp</dimen>
<dimen name="publish_avatar_size">96dp</dimen>
<dimen name="incoming_call_radius">48dp</dimen>
<dimen name="avatar_on_details_screen_size">56dp</dimen>

View file

@ -1006,4 +1006,43 @@
<string name="action_delete">Delete</string>
<string name="attach_choose_video">Choose video</string>
<string name="please_enable_an_account">Please enable an account</string>
<string name="server_info_external_service_discovery">XEP-0215: External Service Discovery</string>
<string name="return_to_ongoing_call">Return to ongoing call</string>
<string name="make_call">Make call</string>
<string name="audio_call">Audio call</string>
<string name="video_call">Video Call</string>
<string name="pref_message_notification_settings">Message notification settings</string>
<string name="pref_incoming_call_notification_settings">Incoming calls notification settings</string>
<string name="pref_notification_sound_summary">Notification sound for new messages</string>
<string name="pref_notification_sound">Notification sound</string>
<string name="pref_call_ringtone_summary">Ringtone for incoming call</string>
<string name="pref_ringtone">Ringtone</string>
<string name="incoming_calls_channel_name">Incoming calls</string>
<string name="ongoing_calls_channel_name">Ongoing calls</string>
<string name="rtp_state_incoming_video_call">Incoming video call</string>
<string name="rtp_state_incoming_call">Incoming call</string>
<string name="dismiss_call">Dismiss</string>
<string name="answer_call">Answer</string>
<string name="ongoing_call">Ongoing call</string>
<string name="ongoing_video_call">Ongoing video call</string>
<string name="hang_up">Hang up</string>
<string name="notification_group_calls">Calls</string>
<string name="microphone_unavailable">Your microphone is unavailable</string>
<string name="rtp_state_connecting">Connecting</string>
<string name="rtp_state_connected">Connected</string>
<string name="rtp_state_accepting_call">Accepting call</string>
<string name="rtp_state_ending_call">Ending call</string>
<string name="rtp_state_finding_device">Locating devices</string>
<string name="rtp_state_ringing">Ringing</string>
<string name="rtp_state_declined_or_busy">Busy</string>
<string name="rtp_state_connectivity_error">Unable to connect call</string>
<string name="rtp_state_retracted">Retracted call</string>
<string name="rtp_state_application_failure">Application failure</string>
<string name="incoming_call_duration">Incoming call · %s</string>
<string name="incoming_call">Incoming call</string>
<string name="outgoing_call_duration">Outgoing call · %s</string>
<string name="outgoing_call">Outgoing call</string>
<string name="disable_tor_to_make_call">Disable Tor to make calls</string>
<string name="only_one_call_at_a_time">You can only have one call at a time.</string>
<string name="missed_call">Missed call</string>
</resources>