diff --git a/app/build.gradle b/app/build.gradle index 661bf3cce..6b894348c 100644 --- a/app/build.gradle +++ b/app/build.gradle @@ -4,9 +4,11 @@ * @author Mario Danic * @author Andy Scherzinger * @author Marcel Hibbe + * @author Tim Krüger * Copyright (C) 2021 Andy Scherzinger * Copyright (C) 2017-2019 Mario Danic * Copyright (C) 2021 Marcel Hibbe + * Copyright (C) 2022 Tim Krüger * * 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 @@ -34,6 +36,20 @@ configurations { ktlint } +def urlFile = { url, fileName -> + File file = new File("$buildDir/download/${fileName}") + file.parentFile.mkdirs() + if (!file.exists()) { + new URL(url).withInputStream { downloadStream -> + file.withOutputStream { fileOut -> + fileOut << downloadStream + } + } + } + files(file.absolutePath) +} + + android { compileSdkVersion 30 buildToolsVersion '30.0.3' @@ -134,6 +150,7 @@ android { } check.dependsOn 'spotbugsGplayDebugReport', 'lint', 'ktlint', 'detekt' + lint.dependsOn 'preBuild' compileOptions { sourceCompatibility JavaVersion.VERSION_1_8 @@ -240,7 +257,8 @@ dependencies { kapt "com.jakewharton:butterknife-compiler:${butterknifeVersion}" implementation 'eu.davidea:flexible-adapter:5.1.0' implementation 'eu.davidea:flexible-adapter-ui:1.0.0' - implementation 'org.webrtc:google-webrtc:1.0.32006' + implementation urlFile('https://github.com/nextcloud-releases/talk-clients-webrtc/releases/download/96.4664.0-RC1/libwebrtc-96.4664.0.aar', + 'libwebrtc-96.4664.0.aar') implementation 'com.yarolegovich:lovely-dialog:1.1.1' implementation 'com.yarolegovich:mp:1.1.6' implementation 'me.zhanghai.android.effortlesspermissions:library:1.1.0' diff --git a/app/src/main/java/com/nextcloud/talk/webrtc/MagicPeerConnectionWrapper.java b/app/src/main/java/com/nextcloud/talk/webrtc/MagicPeerConnectionWrapper.java index 4d29af22b..f9467d809 100644 --- a/app/src/main/java/com/nextcloud/talk/webrtc/MagicPeerConnectionWrapper.java +++ b/app/src/main/java/com/nextcloud/talk/webrtc/MagicPeerConnectionWrapper.java @@ -105,9 +105,12 @@ public class MagicPeerConnectionWrapper { magicSdpObserver = new MagicSdpObserver(); hasInitiated = sessionId.compareTo(localSession) < 0; this.isMCUPublisher = isMCUPublisher; - - peerConnection = peerConnectionFactory.createPeerConnection(iceServerList, sdpConstraints, - new MagicPeerConnectionObserver()); + + PeerConnection.RTCConfiguration configuration = new PeerConnection.RTCConfiguration(iceServerList); + configuration.sdpSemantics = PeerConnection.SdpSemantics.PLAN_B; + + peerConnection = peerConnectionFactory.createPeerConnection(configuration, sdpConstraints, + new MagicPeerConnectionObserver()); if (peerConnection != null) { if (localMediaStream != null) { diff --git a/scripts/analysis/lint-up.rb b/scripts/analysis/lint-up.rb index 245866521..44eb132d8 100644 --- a/scripts/analysis/lint-up.rb +++ b/scripts/analysis/lint-up.rb @@ -56,12 +56,12 @@ end # run Lint puts "running Lint..." -system './gradlew --console=plain clean lintGplayDebug' +system './gradlew --console=plain lintGplayDebug' # confirm that Lint ran w/out error result = $?.to_i if result != 0 - puts "FAIL: failed to run ./gradlew --console=plain clean lintGplayDebug" + puts "FAIL: failed to run ./gradlew --console=plain lintGplayDebug" exit 1 end