Skip to content

Commit

Permalink
Merge branch 'master' into develop
Browse files Browse the repository at this point in the history
  • Loading branch information
inetic committed Sep 18, 2024
2 parents 3ba76a2 + 05851e5 commit aa9acf8
Show file tree
Hide file tree
Showing 2 changed files with 28 additions and 0 deletions.
22 changes: 22 additions & 0 deletions bindings/dart/android/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -119,6 +119,28 @@ cargo {
profile = gradle.startParameter.taskNames.any{it.toLowerCase().contains("debug")} ? "debug" : "release"

extraCargoBuildArguments = ['-p', 'ouisync-ffi']

// HACK: Recent NDK (since r23) no longer links `libgcc`, which breaks some libraries since
// they depended on the symbols from `libclang_rt.builtins-x86_64-android`
// (e.g. `__extenddftf2`, ...). To work around it, we link the library explicitly by setting
// it through the RUSTFLAGS env variable.
// More info: https://github.com/bbqsrc/cargo-ndk/issues/94.
exec { spec, toolchain ->
if (toolchain.target == 'x86_64-linux-android') {
def os_toolchain
if (System.properties['os.name'].toLowerCase().contains('windows')) {
os_toolchain = 'windows-x86_64'
} else {
os_toolchain = 'linux-x86_64'
}


def clangVersion = '18'
def libDir = "${android.sdkDirectory}/ndk/${android.ndkVersion}/toolchains/llvm/prebuilt/${os_toolchain}/lib/clang/${clangVersion}/lib/linux"

spec.environment('RUSTFLAGS', "-L${libDir} -lstatic=clang_rt.builtins-x86_64-android")
}
}
}

preBuild.dependsOn 'cargoBuild'
6 changes: 6 additions & 0 deletions bindings/dart/lib/local_secret.dart
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,12 @@ class LocalPassword implements LocalSecret, SetLocalSecret {
// Discourage from writing local secret into the log.
@override
String toString() => "LocalPassword(***)";

@override
bool operator ==(Object other) {
if (other is! LocalPassword) return false;
return string == other.string;
}
}

class LocalSecretKey implements LocalSecret {
Expand Down

0 comments on commit aa9acf8

Please sign in to comment.