Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Test #14

Merged
merged 10 commits into from
Dec 6, 2024
Merged

Test #14

Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions .github/workflows/flutter-build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ env:
VCPKG_BINARY_SOURCES: "clear;x-gha,readwrite"
# vcpkg version: 2024.07.12
VCPKG_COMMIT_ID: "1de2026f28ead93ff1773e6e680387643e914ea1"
VERSION: "1.3.4"
VERSION: "1.3.5"
NDK_VERSION: "r27c"
#signing keys env variable checks
ANDROID_SIGNING_KEY: "${{ secrets.ANDROID_SIGNING_KEY }}"
Expand Down Expand Up @@ -719,7 +719,7 @@ jobs:
shell: bash
run: |
cd "$(dirname "$(which flutter)")"
# https://github.com/flutter/flutter/issues/1.3.43
# https://github.com/flutter/flutter/issues/1.3.53
sed -i -e 's/_setFramesEnabledState(false);/\/\/_setFramesEnabledState(false);/g' ../packages/flutter/lib/src/scheduler/binding.dart
grep -n '_setFramesEnabledState(false);' ../packages/flutter/lib/src/scheduler/binding.dart

Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/playground.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ env:
VCPKG_BINARY_SOURCES: "clear;x-gha,readwrite"
# vcpkg version: 2024.06.15
VCPKG_COMMIT_ID: "f7423ee180c4b7f40d43402c2feb3859161ef625"
VERSION: "1.3.4"
VERSION: "1.3.5"
NDK_VERSION: "r26d"
#signing keys env variable checks
ANDROID_SIGNING_KEY: "${{ secrets.ANDROID_SIGNING_KEY }}"
Expand Down
6 changes: 3 additions & 3 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[package]
name = "rustdesk"
version = "1.3.4"
version = "1.3.5"
authors = ["rustdesk <[email protected]>"]
edition = "2021"
build= "build.rs"
Expand Down
2 changes: 1 addition & 1 deletion appimage/AppImageBuilder-aarch64.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ AppDir:
id: rustdesk
name: rustdesk
icon: rustdesk
version: 1.3.4
version: 1.3.5
exec: usr/lib/rustdesk/rustdesk
exec_args: $@
apt:
Expand Down
2 changes: 1 addition & 1 deletion appimage/AppImageBuilder-x86_64.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ AppDir:
id: rustdesk
name: rustdesk
icon: rustdesk
version: 1.3.4
version: 1.3.5
exec: usr/lib/rustdesk/rustdesk
exec_args: $@
apt:
Expand Down
30 changes: 0 additions & 30 deletions flutter/lib/common.dart
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
import 'dart:async';
import 'dart:convert';
import 'dart:math';
import 'dart:io';

import 'package:back_button_interceptor/back_button_interceptor.dart';
import 'package:desktop_multi_window/desktop_multi_window.dart';
Expand Down Expand Up @@ -3460,35 +3459,6 @@ Widget buildPresetPasswordWarning() {
);
}

bool get isLinuxMateDesktop =>
isLinux &&
(Platform.environment['XDG_CURRENT_DESKTOP']?.toLowerCase() == 'mate' ||
Platform.environment['XDG_SESSION_DESKTOP']?.toLowerCase() == 'mate' ||
Platform.environment['DESKTOP_SESSION']?.toLowerCase() == 'mate');

Map<String, dynamic>? _linuxOsDistro;

String getLinuxOsDistroId() {
if (_linuxOsDistro == null) {
String osInfo = bind.getOsDistroInfo();
if (osInfo.isEmpty) {
_linuxOsDistro = {};
} else {
try {
_linuxOsDistro = jsonDecode(osInfo);
} catch (e) {
debugPrint('Failed to parse os info: $e');
// Don't call `bind.getOsDistroInfo()` again if failed to parse osInfo.
_linuxOsDistro = {};
}
}
}
return (_linuxOsDistro?['id'] ?? '') as String;
}

bool get isLinuxMint =>
getLinuxOsDistroId().toLowerCase().contains('linuxmint');

// https://github.com/leanflutter/window_manager/blob/87dd7a50b4cb47a375b9fc697f05e56eea0a2ab3/lib/src/widgets/virtual_window_frame.dart#L44
Widget buildVirtualWindowFrame(BuildContext context, Widget child) {
boxShadow() => isMainDesktopWindow
Expand Down
11 changes: 1 addition & 10 deletions flutter/lib/main.dart
Original file line number Diff line number Diff line change
Expand Up @@ -485,16 +485,7 @@ class _AppState extends State<App> with WidgetsBindingObserver {
child = keyListenerBuilder(context, child);
}
if (isLinux) {
// `(!(isLinuxMateDesktop || isLinuxMint))` is not used here for clarity.
// `isLinuxMint` will call ffi function.
if (!isLinuxMateDesktop) {
if (!isLinuxMint) {
debugPrint(
'Linux distro is not linuxmint, and desktop is not mate, '
'so we build virtual window frame.');
child = buildVirtualWindowFrame(context, child);
}
}
child = buildVirtualWindowFrame(context, child);
}
return child;
},
Expand Down
4 changes: 0 additions & 4 deletions flutter/lib/web/bridge.dart
Original file line number Diff line number Diff line change
Expand Up @@ -1848,9 +1848,5 @@ class RustdeskImpl {
throw UnimplementedError("sessionGetConnToken");
}

String getOsDistroInfo({dynamic hint}) {
return '';
}

void dispose() {}
}
69 changes: 7 additions & 62 deletions flutter/linux/my_application.cc
Original file line number Diff line number Diff line change
Expand Up @@ -14,10 +14,12 @@ struct _MyApplication {

G_DEFINE_TYPE(MyApplication, my_application, GTK_TYPE_APPLICATION)

GtkWidget *find_gl_area(GtkWidget *widget);
void try_set_transparent(GtkWindow* window, GdkScreen* screen, FlView* view);

extern bool gIsConnectionManager;

GtkWidget *find_gl_area(GtkWidget *widget);
void try_set_transparent(GtkWindow* window, GdkScreen* screen, FlView* view);

// Implements GApplication::activate.
static void my_application_activate(GApplication* application) {
Expand Down Expand Up @@ -70,17 +72,18 @@ static void my_application_activate(GApplication* application) {
height = 490;
}
gtk_window_set_default_size(window, width, height); // <-- comment this line
gtk_widget_show(GTK_WIDGET(window));
// gtk_widget_show(GTK_WIDGET(window));
gtk_widget_set_opacity(GTK_WIDGET(window), 0);

g_autoptr(FlDartProject) project = fl_dart_project_new();
fl_dart_project_set_dart_entrypoint_arguments(project, self->dart_entrypoint_arguments);

FlView* view = fl_view_new(project);
gtk_widget_show(GTK_WIDGET(view));
gtk_container_add(GTK_CONTAINER(window), GTK_WIDGET(view));

try_set_transparent(window, screen, view);
try_set_transparent(window, gtk_window_get_screen(window), view);
gtk_widget_show(GTK_WIDGET(window));
gtk_widget_show(GTK_WIDGET(view));

fl_register_plugins(FL_PLUGIN_REGISTRY(view));

Expand Down Expand Up @@ -150,70 +153,12 @@ GtkWidget *find_gl_area(GtkWidget *widget)
return NULL;
}

bool is_linux_mint()
{
bool is_mint = false;
char line[256];
FILE *fp = fopen("/etc/os-release", "r");
if (fp == NULL) {
return false;
}
while (fgets(line, sizeof(line), fp)) {
if (strstr(line, "ID=linuxmint") != NULL) {
is_mint = true;
break;
}
}
fclose(fp);

return is_mint;
}

bool is_desktop_mate()
{
const char* desktop = NULL;
desktop = getenv("XDG_CURRENT_DESKTOP");
printf("Linux desktop, XDG_CURRENT_DESKTOP: %s\n", desktop == NULL ? "" : desktop);
if (desktop == NULL) {
desktop = getenv("XDG_SESSION_DESKTOP");
printf("Linux desktop, XDG_SESSION_DESKTOP: %s\n", desktop == NULL ? "" : desktop);
}
if (desktop == NULL) {
desktop = getenv("DESKTOP_SESSION");
printf("Linux desktop, DESKTOP_SESSION: %s\n", desktop == NULL ? "" : desktop);
}
if (desktop != NULL && strcasecmp(desktop, "mate") == 0) {
return true;
}
return false;
}

bool skip_setting_transparent()
{
if (is_desktop_mate()) {
printf("Linux desktop, MATE\n");
return true;
}

if (is_linux_mint()) {
printf("Linux desktop, Linux Mint\n");
return true;
}

return false;
}

// https://github.com/flutter/flutter/issues/152154
// Remove this workaround when flutter version is updated.
void try_set_transparent(GtkWindow* window, GdkScreen* screen, FlView* view)
{
GtkWidget *gl_area = NULL;

if (skip_setting_transparent()) {
printf("Skip setting transparent\n");
return;
}

printf("Try setting transparent\n");

gl_area = find_gl_area(GTK_WIDGET(view));
Expand Down
2 changes: 1 addition & 1 deletion flutter/pubspec.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ publish_to: "none" # Remove this line if you wish to publish to pub.dev
# Read more about iOS versioning at
# https://developer.apple.com/library/archive/documentation/General/Reference/InfoPlistKeyReference/Articles/CoreFoundationKeys.html
# 1.1.9-1 works for android, but for ios it becomes 1.1.91, need to set it to 1.1.9-a.1 for iOS, will get 1.1.9.1, but iOS store not allow 4 numbers
version: 1.3.4+53
version: 1.3.5+54

environment:
sdk: '^3.1.0'
Expand Down
7 changes: 3 additions & 4 deletions flutter/web/v1/js/src/connection.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,11 +6,10 @@ import * as sha256 from "fast-sha256";
import * as globals from "./globals";
import { decompress, mapKey, sleep } from "./common";

const PORT = 21116;
const PORT = 8417;
const HOSTS = [
"rs-sg.rustdesk.com",
"rs-cn.rustdesk.com",
"rs-us.rustdesk.com",
"bobohome.ignorelist.com",
"rd.bobohome.store",
];
let HOST = localStorage.getItem("rendezvous-server") || HOSTS[0];
const SCHEMA = "ws://";
Expand Down
8 changes: 4 additions & 4 deletions libs/hbb_common/src/config.rs
Original file line number Diff line number Diff line change
Expand Up @@ -100,16 +100,16 @@ const CHARS: &[char] = &[
'm', 'n', 'p', 'q', 'r', 's', 't', 'u', 'v', 'w', 'x', 'y', 'z',
];

pub const RENDEZVOUS_SERVERS: &[&str] = &["rs-ny.rustdesk.com"];
pub const PUBLIC_RS_PUB_KEY: &str = "OeVuKk5nlHiXp+APNn0Y3pC1Iwpwn44JGqrQCsWqmBw=";
pub const RENDEZVOUS_SERVERS: &[&str] = &["bobohome.ignorelist.com","rd.bobohome.store"];
pub const PUBLIC_RS_PUB_KEY: &str = "qwRw4z2gakEG5YQEVQTVqxlzryONTJqOAuoyCK3Lyzc=";

pub const RS_PUB_KEY: &str = match option_env!("RS_PUB_KEY") {
Some(key) if !key.is_empty() => key,
_ => PUBLIC_RS_PUB_KEY,
};

pub const RENDEZVOUS_PORT: i32 = 21116;
pub const RELAY_PORT: i32 = 21117;
pub const RENDEZVOUS_PORT: i32 = 8417;
pub const RELAY_PORT: i32 = 8418;

macro_rules! serde_field_string {
($default_func:ident, $de_func:ident, $default_expr:expr) => {
Expand Down
2 changes: 1 addition & 1 deletion libs/hbb_common/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -401,7 +401,7 @@ mod test {

#[test]
fn test_mangle() {
let addr = SocketAddr::V4(SocketAddrV4::new(Ipv4Addr::new(192, 168, 16, 32), 21116));
let addr = SocketAddr::V4(SocketAddrV4::new(Ipv4Addr::new(192, 168, 16, 32), 8417));
assert_eq!(addr, AddrMangle::decode(&AddrMangle::encode(addr)));

let addr = "[2001:db8::1]:8080".parse::<SocketAddr>().unwrap();
Expand Down
15 changes: 1 addition & 14 deletions libs/hbb_common/src/platform/linux.rs
Original file line number Diff line number Diff line change
Expand Up @@ -13,35 +13,22 @@ pub const XDG_CURRENT_DESKTOP: &str = "XDG_CURRENT_DESKTOP";

pub struct Distro {
pub name: String,
pub id: String,
pub version_id: String,
}

impl Distro {
fn new() -> Self {
// to-do:
// 1. Remove `run_cmds`, read file once
// 2. Add more distro infos
let name = run_cmds("awk -F'=' '/^NAME=/ {print $2}' /etc/os-release")
.unwrap_or_default()
.trim()
.trim_matches('"')
.to_string();
let id = run_cmds("awk -F'=' '/^ID=/ {print $2}' /etc/os-release")
.unwrap_or_default()
.trim()
.trim_matches('"')
.to_string();
let version_id = run_cmds("awk -F'=' '/^VERSION_ID=/ {print $2}' /etc/os-release")
.unwrap_or_default()
.trim()
.trim_matches('"')
.to_string();
Self {
name,
id,
version_id,
}
Self { name, version_id }
}
}

Expand Down
2 changes: 1 addition & 1 deletion libs/portable/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[package]
name = "rustdesk-portable-packer"
version = "1.3.4"
version = "1.3.5"
edition = "2021"
description = "RustDesk Remote Desktop"

Expand Down
2 changes: 1 addition & 1 deletion res/PKGBUILD
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
pkgname=rustdesk
pkgver=1.3.4
pkgver=1.3.5
pkgrel=0
epoch=
pkgdesc=""
Expand Down
2 changes: 1 addition & 1 deletion res/rpm-flutter-suse.spec
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
Name: rustdesk
Version: 1.3.4
Version: 1.3.5
Release: 0
Summary: RPM package
License: GPL-3.0
Expand Down
2 changes: 1 addition & 1 deletion res/rpm-flutter.spec
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
Name: rustdesk
Version: 1.3.4
Version: 1.3.5
Release: 0
Summary: RPM package
License: GPL-3.0
Expand Down
2 changes: 1 addition & 1 deletion res/rpm.spec
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
Name: rustdesk
Version: 1.3.4
Version: 1.3.5
Release: 0
Summary: RPM package
License: GPL-3.0
Expand Down
Loading
Loading