Compare commits

..

2 Commits

Author SHA1 Message Date
akwizgran
b3e1c62aff Fix BlueCove address and URL format. 2022-02-21 16:04:00 +00:00
akwizgran
1020c70c22 Use BlueCove 2.1.0. 2022-02-21 16:02:45 +00:00
6 changed files with 15 additions and 70 deletions

View File

@@ -17,6 +17,9 @@ dependencies {
def jna_version = '4.5.2'
implementation "net.java.dev.jna:jna:$jna_version"
implementation "net.java.dev.jna:jna-platform:$jna_version"
def bluecove_version = '2.1.0'
implementation "net.sf.bluecove:bluecove:$bluecove_version"
implementation "net.sf.bluecove:bluecove-gpl:$bluecove_version"
tor "org.briarproject:tor:$tor_version"
tor "org.briarproject:obfs4proxy:$obfs4proxy_version@zip"

View File

@@ -21,7 +21,9 @@ import javax.microedition.io.StreamConnectionNotifier;
import static java.util.logging.Level.WARNING;
import static java.util.logging.Logger.getLogger;
import static org.briarproject.bramble.util.LogUtils.logException;
import static org.briarproject.bramble.util.StringUtils.fromHexString;
import static org.briarproject.bramble.util.StringUtils.isValidMac;
import static org.briarproject.bramble.util.StringUtils.macToString;
@MethodsNotNullByDefault
@ParametersNotNullByDefault
@@ -65,12 +67,13 @@ class JavaBluetoothPlugin extends
@Nullable
@Override
String getBluetoothAddress() {
return localDevice.getBluetoothAddress();
if (localDevice == null) return null;
return macToString(fromHexString(localDevice.getBluetoothAddress()));
}
@Override
StreamConnectionNotifier openServerSocket(String uuid) throws IOException {
String url = makeUrl("localhost", uuid);
String url = makeServerSocketUrl(uuid);
return (StreamConnectionNotifier) Connector.open(url);
}
@@ -97,9 +100,7 @@ class JavaBluetoothPlugin extends
@Override
DuplexTransportConnection connectTo(String address, String uuid)
throws IOException {
String url = makeUrl(address, uuid);
StreamConnection s = (StreamConnection) Connector.open(url);
return connectionFactory.wrapSocket(this, s);
throw new IOException("Not implemented"); // TODO
}
@Override
@@ -113,7 +114,9 @@ class JavaBluetoothPlugin extends
// TODO
}
private String makeUrl(String address, String uuid) {
return "btspp://" + address + ":" + uuid + ";name=RFCOMM";
private String makeServerSocketUrl(String uuid) {
uuid = uuid.replaceAll("-", "");
return "btspp://" + "localhost" + ":" + uuid
+ ";encrypt=false;authenticate=false";
}
}

View File

@@ -23,6 +23,8 @@ dependencyVerification {
'net.java.dev.jna:jna:4.5.2:jna-4.5.2.jar:0c8eb7acf67261656d79005191debaba3b6bf5dd60a43735a245429381dbecff',
'net.jcip:jcip-annotations:1.0:jcip-annotations-1.0.jar:be5805392060c71474bf6c9a67a099471274d30b83eef84bfc4e0889a4f1dcc0',
'net.ltgt.gradle.incap:incap:0.2:incap-0.2.jar:b625b9806b0f1e4bc7a2e3457119488de3cd57ea20feedd513db070a573a4ffd',
'net.sf.bluecove:bluecove-gpl:2.1.0:bluecove-gpl-2.1.0.jar:6b697a3d4d50be16b86cdfad6aac173251f1fd0dce83f4947d1ed7b2aea894d0',
'net.sf.bluecove:bluecove:2.1.0:bluecove-2.1.0.jar:add9a58dbee3eaa35a062010a11066ba772a72119f24165f4adf0e19e60a4b8a',
'org.apache-extras.beanshell:bsh:2.0b6:bsh-2.0b6.jar:a17955976070c0573235ee662f2794a78082758b61accffce8d3f8aedcd91047',
'org.briarproject:obfs4proxy:0.0.12-dev-40245c4a:obfs4proxy-0.0.12-dev-40245c4a.zip:172029e7058b3a83ac93ac4991a44bf76e16ce8d46f558f5836d57da3cb3a766',
'org.briarproject:tor:0.3.5.17:tor-0.3.5.17.jar:ce0e1f4d8f14878e61b23a35a452bc0f2a8e3117ced5a74773cd78475fa7af39',

View File

@@ -1,63 +0,0 @@
diff -Bbur bluecove-2.1.1-SNAPSHOT/bluecove/pom.xml bluecove-2.1.1-SNAPSHOT-briar/bluecove/pom.xml
--- bluecove-2.1.1-SNAPSHOT/bluecove/pom.xml 2013-01-04 00:43:17.961294408 +0000
+++ bluecove-2.1.1-SNAPSHOT-briar/bluecove/pom.xml 2013-01-03 23:17:37.549293571 +0000
@@ -126,8 +126,8 @@
<plugin>
<artifactId>maven-compiler-plugin</artifactId>
<configuration>
- <source>1.3</source>
- <target>1.1</target>
+ <source>1.5</source>
+ <target>1.5</target>
</configuration>
</plugin>
@@ -355,7 +355,7 @@
<configuration>
<linkXref>true</linkXref>
<minimumTokens>100</minimumTokens>
- <targetJdk>1.4</targetJdk>
+ <targetJdk>1.5</targetJdk>
</configuration>
</plugin>
<plugin>
diff -Bbur bluecove-2.1.1-SNAPSHOT/bluecove/src/main/c/intelbth/OSXStackRFCOMMServer.mm bluecove-2.1.1-SNAPSHOT-briar/bluecove/src/main/c/intelbth/OSXStackRFCOMMServer.mm
--- bluecove-2.1.1-SNAPSHOT/bluecove/src/main/c/intelbth/OSXStackRFCOMMServer.mm 2013-01-04 00:43:17.549293781 +0000
+++ bluecove-2.1.1-SNAPSHOT-briar/bluecove/src/main/c/intelbth/OSXStackRFCOMMServer.mm 2013-01-03 23:19:02.269295705 +0000
@@ -280,6 +280,10 @@
ndebug(("fail to get IOBluetoothRFCOMMChannel"));
return;
}
+ if(![rfcommChannel isIncoming]) {
+ ndebug(("ignoring outgoing connection"));
+ return;
+ }
if (comm->authenticate) {
IOBluetoothDevice* device = [rfcommChannel getDevice];
if (device == NULL) {
diff -Bbur bluecove-2.1.1-SNAPSHOT/bluecove-gpl/pom.xml bluecove-2.1.1-SNAPSHOT-briar/bluecove-gpl/pom.xml
--- bluecove-2.1.1-SNAPSHOT/bluecove-gpl/pom.xml 2013-01-04 00:43:14.509294005 +0000
+++ bluecove-2.1.1-SNAPSHOT-briar/bluecove-gpl/pom.xml 2013-01-03 23:17:52.181293751 +0000
@@ -81,8 +81,8 @@
<plugin>
<artifactId>maven-compiler-plugin</artifactId>
<configuration>
- <source>1.3</source>
- <target>1.1</target>
+ <source>1.5</source>
+ <target>1.5</target>
</configuration>
</plugin>
diff -Bbur bluecove-2.1.1-SNAPSHOT/pom.xml bluecove-2.1.1-SNAPSHOT-briar/pom.xml
--- bluecove-2.1.1-SNAPSHOT/pom.xml 2013-01-04 00:43:19.721293788 +0000
+++ bluecove-2.1.1-SNAPSHOT-briar/pom.xml 2013-01-03 23:17:18.713293930 +0000
@@ -436,7 +436,7 @@
<configuration>
<linkXref>true</linkXref>
<minimumTokens>100</minimumTokens>
- <targetJdk>1.4</targetJdk>
+ <targetJdk>1.5</targetJdk>
</configuration>
</plugin>
<plugin>