opt: add microphone permission tip
This commit is contained in:
parent
038d660e60
commit
ebec8811c2
@ -1723,3 +1723,30 @@ Future<void> updateSystemWindowTheme() async {
|
||||
}
|
||||
}
|
||||
}
|
||||
/// macOS only
|
||||
///
|
||||
/// Note: not found a general solution for rust based AVFoundation bingding.
|
||||
/// [AVFoundation] crate has compile error.
|
||||
const kMacOSPermChannel = MethodChannel("org.rustdesk.rustdesk/macos");
|
||||
|
||||
enum PermissionAuthorizeType {
|
||||
undetermined,
|
||||
authorized,
|
||||
denied, // and restricted
|
||||
}
|
||||
|
||||
Future<PermissionAuthorizeType> osxCanRecordAudio() async {
|
||||
int res = await kMacOSPermChannel.invokeMethod("canRecordAudio");
|
||||
print(res);
|
||||
if (res > 0) {
|
||||
return PermissionAuthorizeType.authorized;
|
||||
} else if (res == 0) {
|
||||
return PermissionAuthorizeType.undetermined;
|
||||
} else {
|
||||
return PermissionAuthorizeType.denied;
|
||||
}
|
||||
}
|
||||
|
||||
Future<bool> osxRequestAudio() async {
|
||||
return await kMacOSPermChannel.invokeMethod("requestRecordAudio");
|
||||
}
|
||||
|
@ -44,6 +44,7 @@ class _DesktopHomePageState extends State<DesktopHomePage>
|
||||
var watchIsCanScreenRecording = false;
|
||||
var watchIsProcessTrust = false;
|
||||
var watchIsInputMonitoring = false;
|
||||
var watchIsCanRecordAudio = false;
|
||||
Timer? _updateTimer;
|
||||
|
||||
@override
|
||||
@ -79,7 +80,16 @@ class _DesktopHomePageState extends State<DesktopHomePage>
|
||||
buildTip(context),
|
||||
buildIDBoard(context),
|
||||
buildPasswordBoard(context),
|
||||
buildHelpCards(),
|
||||
FutureBuilder<Widget>(
|
||||
future: buildHelpCards(),
|
||||
builder: (_, data) {
|
||||
if (data.hasData) {
|
||||
return data.data!;
|
||||
} else {
|
||||
return const Offstage();
|
||||
}
|
||||
},
|
||||
),
|
||||
],
|
||||
),
|
||||
),
|
||||
@ -302,7 +312,7 @@ class _DesktopHomePageState extends State<DesktopHomePage>
|
||||
);
|
||||
}
|
||||
|
||||
Widget buildHelpCards() {
|
||||
Future<Widget> buildHelpCards() async {
|
||||
if (updateUrl.isNotEmpty) {
|
||||
return buildInstallCard(
|
||||
"Status",
|
||||
@ -348,6 +358,13 @@ class _DesktopHomePageState extends State<DesktopHomePage>
|
||||
return buildInstallCard("", "install_daemon_tip", "Install", () async {
|
||||
bind.mainIsInstalledDaemon(prompt: true);
|
||||
});
|
||||
} else if ((await osxCanRecordAudio() !=
|
||||
PermissionAuthorizeType.authorized)) {
|
||||
return buildInstallCard("Permissions", "config_microphone", "Configure",
|
||||
() async {
|
||||
osxRequestAudio();
|
||||
watchIsCanRecordAudio = true;
|
||||
});
|
||||
}
|
||||
} else if (Platform.isLinux) {
|
||||
if (bind.mainCurrentIsWayland()) {
|
||||
@ -481,6 +498,20 @@ class _DesktopHomePageState extends State<DesktopHomePage>
|
||||
setState(() {});
|
||||
}
|
||||
}
|
||||
if (watchIsCanRecordAudio) {
|
||||
if (Platform.isMacOS) {
|
||||
Future.microtask(() async {
|
||||
if ((await osxCanRecordAudio() ==
|
||||
PermissionAuthorizeType.authorized)) {
|
||||
watchIsCanRecordAudio = false;
|
||||
setState(() {});
|
||||
}
|
||||
});
|
||||
} else {
|
||||
watchIsCanRecordAudio = false;
|
||||
setState(() {});
|
||||
}
|
||||
}
|
||||
});
|
||||
Get.put<RxBool>(svcStopped, tag: 'stop-service');
|
||||
rustDeskWinManager.registerActiveWindowListener(onActiveWindowChanged);
|
||||
|
@ -43,6 +43,8 @@
|
||||
<string>$(PRODUCT_COPYRIGHT)</string>
|
||||
<key>NSMainNibFile</key>
|
||||
<string>MainMenu</string>
|
||||
<key>NSMicrophoneUsageDescription</key>
|
||||
<string>Record the sound from microphone for the purpose of the remote desktop.</string>
|
||||
<key>NSPrincipalClass</key>
|
||||
<string>NSApplication</string>
|
||||
</dict>
|
||||
|
@ -1,4 +1,5 @@
|
||||
import Cocoa
|
||||
import AVFoundation
|
||||
import FlutterMacOS
|
||||
import desktop_multi_window
|
||||
// import bitsdojo_window_macos
|
||||
@ -81,6 +82,23 @@ class MainFlutterWindow: NSWindow {
|
||||
case "terminate":
|
||||
NSApplication.shared.terminate(self)
|
||||
result(nil)
|
||||
case "canRecordAudio":
|
||||
switch AVCaptureDevice.authorizationStatus(for: .audio) {
|
||||
case .authorized:
|
||||
result(1)
|
||||
break
|
||||
case .notDetermined:
|
||||
result(0)
|
||||
break
|
||||
default:
|
||||
result(-1)
|
||||
break
|
||||
}
|
||||
case "requestRecordAudio":
|
||||
AVCaptureDevice.requestAccess(for: .audio, completionHandler: { granted in
|
||||
result(granted)
|
||||
})
|
||||
break
|
||||
default:
|
||||
result(FlutterMethodNotImplemented)
|
||||
}
|
||||
|
@ -415,6 +415,7 @@ pub static ref T: std::collections::HashMap<&'static str, &'static str> =
|
||||
("software_render_tip", ""),
|
||||
("Always use software rendering", ""),
|
||||
("config_input", ""),
|
||||
("config_microphone", ""),
|
||||
("request_elevation_tip", ""),
|
||||
("Wait", ""),
|
||||
("Elevation Error", ""),
|
||||
|
@ -415,6 +415,7 @@ pub static ref T: std::collections::HashMap<&'static str, &'static str> =
|
||||
("software_render_tip", "如果你使用英伟达显卡, 并且远程窗口在会话建立后会立刻关闭, 那么安装 nouveau 驱动并且选择使用软件渲染可能会有帮助。重启软件后生效。"),
|
||||
("Always use software rendering", "使用软件渲染"),
|
||||
("config_input", "为了能够通过键盘控制远程桌面, 请给予 RustDesk \"输入监控\" 权限。"),
|
||||
("config_microphone", "为了支持通过麦克风进行音频传输,请给予 RustDesk \"录音\"权限。"),
|
||||
("request_elevation_tip", "如果对面有人, 也可以请求提升权限。"),
|
||||
("Wait", "等待"),
|
||||
("Elevation Error", "提权失败"),
|
||||
|
@ -415,6 +415,7 @@ pub static ref T: std::collections::HashMap<&'static str, &'static str> =
|
||||
("software_render_tip", ""),
|
||||
("Always use software rendering", ""),
|
||||
("config_input", ""),
|
||||
("config_microphone", ""),
|
||||
("request_elevation_tip", ""),
|
||||
("Wait", ""),
|
||||
("Elevation Error", ""),
|
||||
|
@ -415,6 +415,7 @@ pub static ref T: std::collections::HashMap<&'static str, &'static str> =
|
||||
("software_render_tip", ""),
|
||||
("Always use software rendering", ""),
|
||||
("config_input", ""),
|
||||
("config_microphone", ""),
|
||||
("request_elevation_tip", ""),
|
||||
("Wait", ""),
|
||||
("Elevation Error", ""),
|
||||
|
@ -415,6 +415,7 @@ pub static ref T: std::collections::HashMap<&'static str, &'static str> =
|
||||
("software_render_tip", "Wenn Sie eine Nvidia-Grafikkarte haben und sich das entfernte Fenster sofort nach dem Herstellen der Verbindung schließt, kann es helfen, den Nouveau-Treiber zu installieren und Software-Rendering zu verwenden. Ein Neustart der Software ist erforderlich."),
|
||||
("Always use software rendering", "Software-Rendering immer verwenden"),
|
||||
("config_input", "Um den entfernten Desktop mit der Tastatur steuern zu können, müssen Sie RustDesk \"Input Monitoring\"-Rechte erteilen."),
|
||||
("config_microphone", ""),
|
||||
("request_elevation_tip", "Sie können auch erhöhte Rechte anfordern, wenn sich jemand auf der Gegenseite befindet."),
|
||||
("Wait", "Warten"),
|
||||
("Elevation Error", "Berechtigungsfehler"),
|
||||
|
@ -41,6 +41,7 @@ pub static ref T: std::collections::HashMap<&'static str, &'static str> =
|
||||
("config_input", "In order to control remote desktop with keyboard, you need to grant RustDesk \"Input Monitoring\" permissions."),
|
||||
("request_elevation_tip","You can also request elevation if there is someone on the remote side."),
|
||||
("wait_accept_uac_tip","Please wait for the remote user to accept the UAC dialog."),
|
||||
("still_click_uac_tip", "Still requires the remote user to click OK on the UAC window of running RustDesk.")
|
||||
("still_click_uac_tip", "Still requires the remote user to click OK on the UAC window of running RustDesk."),
|
||||
("config_microphone", "In order to speak remotely, you need to grant RustDesk \"Record Audio\" permissions.")
|
||||
].iter().cloned().collect();
|
||||
}
|
||||
|
@ -415,6 +415,7 @@ pub static ref T: std::collections::HashMap<&'static str, &'static str> =
|
||||
("software_render_tip", ""),
|
||||
("Always use software rendering", ""),
|
||||
("config_input", ""),
|
||||
("config_microphone", ""),
|
||||
("request_elevation_tip", ""),
|
||||
("Wait", ""),
|
||||
("Elevation Error", ""),
|
||||
|
@ -415,6 +415,7 @@ pub static ref T: std::collections::HashMap<&'static str, &'static str> =
|
||||
("software_render_tip", "Si tienes una gráfica Nvidia y la ventana remota se cierra inmediatamente, instalar el driver nouveau y elegir renderizado por software podría ayudar. Se requiere reiniciar la aplicación."),
|
||||
("Always use software rendering", "Usar siempre renderizado por software"),
|
||||
("config_input", "Para controlar el escritorio remoto con el teclado necesitas dar a RustDesk permisos de \"Monitorización de entrada\"."),
|
||||
("config_microphone", ""),
|
||||
("request_elevation_tip", "También puedes solicitar elevación si hay alguien en el lado remoto."),
|
||||
("Wait", "Esperar"),
|
||||
("Elevation Error", "Error de elevación"),
|
||||
|
@ -415,6 +415,7 @@ pub static ref T: std::collections::HashMap<&'static str, &'static str> =
|
||||
("software_render_tip", "اگر کارت گرافیک Nvidia دارید و پنجره راه دور بلافاصله پس از اتصال بسته می شود، درایور nouveau را نصب نمایید و انتخاب گزینه استفاده از رندر نرم افزار می تواند کمک کننده باشد. راه اندازی مجدد نرم افزار مورد نیاز است."),
|
||||
("Always use software rendering", "همیشه از رندر نرم افزاری استفاده کنید"),
|
||||
("config_input", "برای کنترل دسکتاپ از راه دور با صفحه کلید، باید مجوز RustDesk \"Input Monitoring\" را بدهید."),
|
||||
("config_microphone", ""),
|
||||
("request_elevation_tip", "همچنین می توانید در صورت وجود شخصی در سمت راه دور درخواست ارتفاع دهید."),
|
||||
("Wait", "صبر کنید"),
|
||||
("Elevation Error", "خطای ارتفاع"),
|
||||
|
@ -415,6 +415,7 @@ pub static ref T: std::collections::HashMap<&'static str, &'static str> =
|
||||
("software_render_tip", "Si vous avez une carte graphique NVIDIA et que la fenêtre distante se ferme immédiatement après la connexion, l'installation du pilote Nouveau et le choix d'utiliser le rendu du logiciel peuvent aider. Un redémarrage du logiciel est requis."),
|
||||
("Always use software rendering", "Utiliser toujours le rendu logiciel"),
|
||||
("config_input", "Afin de contrôler le bureau à distance avec le clavier, vous devez accorder à RustDesk l'autorisation \"Surveillance de l’entrée\"."),
|
||||
("config_microphone", ""),
|
||||
("request_elevation_tip", "Vous pouvez également demander une augmentation des privilèges s'il y a quelqu'un du côté distant."),
|
||||
("Wait", "En cours"),
|
||||
("Elevation Error", "Erreur d'augmentation des privilèges"),
|
||||
|
@ -415,6 +415,7 @@ pub static ref T: std::collections::HashMap<&'static str, &'static str> =
|
||||
("software_render_tip", "Εάν έχετε κάρτα γραφικών Nvidia και το παράθυρο σύνδεσης κλείνει αμέσως μετά τη σύνδεση, η εγκατάσταση του προγράμματος οδήγησης nouveau και η επιλογή χρήσης της επιτάχυνσης γραφικών μέσω λογισμικού μπορεί να βοηθήσει. Απαιτείται επανεκκίνηση."),
|
||||
("Always use software rendering", "Επιτάχυνση γραφικών μέσω λογισμικού"),
|
||||
("config_input", "Για να ελέγξετε την απομακρυσμένη επιφάνεια εργασίας με πληκτρολόγιο, πρέπει να εκχωρήσετε δικαιώματα στο RustDesk"),
|
||||
("config_microphone", ""),
|
||||
("request_elevation_tip", "αίτημα ανύψωσης δικαιωμάτων χρήστη"),
|
||||
("Wait", "Περιμένετε"),
|
||||
("Elevation Error", "Σφάλμα ανύψωσης δικαιωμάτων χρήστη"),
|
||||
|
@ -415,6 +415,7 @@ pub static ref T: std::collections::HashMap<&'static str, &'static str> =
|
||||
("software_render_tip", ""),
|
||||
("Always use software rendering", ""),
|
||||
("config_input", ""),
|
||||
("config_microphone", ""),
|
||||
("request_elevation_tip", ""),
|
||||
("Wait", ""),
|
||||
("Elevation Error", ""),
|
||||
|
@ -415,6 +415,7 @@ pub static ref T: std::collections::HashMap<&'static str, &'static str> =
|
||||
("software_render_tip", ""),
|
||||
("Always use software rendering", ""),
|
||||
("config_input", ""),
|
||||
("config_microphone", ""),
|
||||
("request_elevation_tip", ""),
|
||||
("Wait", ""),
|
||||
("Elevation Error", ""),
|
||||
|
@ -415,6 +415,7 @@ pub static ref T: std::collections::HashMap<&'static str, &'static str> =
|
||||
("software_render_tip", "Se si dispone di una scheda grafica Nvidia e la finestra remota si chiude immediatamente dopo la connessione, l'installazione del driver nouveau e la scelta di utilizzare il rendering software possono aiutare. È necessario un riavvio del software."),
|
||||
("Always use software rendering", "Usa sempre il render Software"),
|
||||
("config_input", "Per controllare il desktop remoto con la tastiera, è necessario concedere le autorizzazioni a RustDesk \"Monitoraggio dell'input\"."),
|
||||
("config_microphone", ""),
|
||||
("request_elevation_tip", "È possibile richiedere l'elevazione se c'è qualcuno sul lato remoto."),
|
||||
("Wait", "Attendi"),
|
||||
("Elevation Error", "Errore durante l'elevazione dei diritti"),
|
||||
|
@ -415,6 +415,7 @@ pub static ref T: std::collections::HashMap<&'static str, &'static str> =
|
||||
("software_render_tip", ""),
|
||||
("Always use software rendering", ""),
|
||||
("config_input", ""),
|
||||
("config_microphone", ""),
|
||||
("request_elevation_tip", ""),
|
||||
("Wait", ""),
|
||||
("Elevation Error", ""),
|
||||
|
@ -415,6 +415,7 @@ pub static ref T: std::collections::HashMap<&'static str, &'static str> =
|
||||
("software_render_tip", ""),
|
||||
("Always use software rendering", ""),
|
||||
("config_input", ""),
|
||||
("config_microphone", ""),
|
||||
("request_elevation_tip", ""),
|
||||
("Wait", ""),
|
||||
("Elevation Error", ""),
|
||||
|
@ -415,6 +415,7 @@ pub static ref T: std::collections::HashMap<&'static str, &'static str> =
|
||||
("software_render_tip", ""),
|
||||
("Always use software rendering", ""),
|
||||
("config_input", ""),
|
||||
("config_microphone", ""),
|
||||
("request_elevation_tip", ""),
|
||||
("Wait", ""),
|
||||
("Elevation Error", ""),
|
||||
|
@ -415,6 +415,7 @@ pub static ref T: std::collections::HashMap<&'static str, &'static str> =
|
||||
("software_render_tip", "Jeżeli posiadasz kartę graficzną Nvidia i okno zamyka się natychmiast po nawiązaniu połączenia, instalacja sterownika nouveau i wybór renderowania programowego mogą pomóc. Restart aplikacji jest wymagany."),
|
||||
("Always use software rendering", "Zawsze używaj renderowania programowego"),
|
||||
("config_input", "By kontrolować zdalne urządzenie przy pomocy klawiatury, musisz udzielić aplikacji RustDesk uprawnień do \"Urządzeń Wejściowych\"."),
|
||||
("config_microphone", ""),
|
||||
("request_elevation_tip", "Możesz poprosić o podniesienie uprawnień jeżeli ktoś posiada dostęp do zdalnego urządzenia."),
|
||||
("Wait", "Czekaj"),
|
||||
("Elevation Error", "Błąd przy podnoszeniu uprawnień"),
|
||||
|
@ -415,6 +415,7 @@ pub static ref T: std::collections::HashMap<&'static str, &'static str> =
|
||||
("software_render_tip", ""),
|
||||
("Always use software rendering", ""),
|
||||
("config_input", ""),
|
||||
("config_microphone", ""),
|
||||
("request_elevation_tip", ""),
|
||||
("Wait", ""),
|
||||
("Elevation Error", ""),
|
||||
|
@ -415,6 +415,7 @@ pub static ref T: std::collections::HashMap<&'static str, &'static str> =
|
||||
("software_render_tip", ""),
|
||||
("Always use software rendering", ""),
|
||||
("config_input", ""),
|
||||
("config_microphone", ""),
|
||||
("request_elevation_tip", ""),
|
||||
("Wait", ""),
|
||||
("Elevation Error", ""),
|
||||
|
@ -415,6 +415,7 @@ pub static ref T: std::collections::HashMap<&'static str, &'static str> =
|
||||
("software_render_tip", ""),
|
||||
("Always use software rendering", ""),
|
||||
("config_input", ""),
|
||||
("config_microphone", ""),
|
||||
("request_elevation_tip", ""),
|
||||
("Wait", ""),
|
||||
("Elevation Error", ""),
|
||||
|
@ -415,6 +415,7 @@ pub static ref T: std::collections::HashMap<&'static str, &'static str> =
|
||||
("software_render_tip", "Если у вас видеокарта Nvidia и удалённое окно закрывается сразу после подключения, может помочь установка драйвера Nouveau и выбор использования программной визуализации. Потребуется перезапуск."),
|
||||
("Always use software rendering", "Использовать программную визуализацию"),
|
||||
("config_input", "Чтобы управлять удалённым рабочим столом с помощью клавиатуры, необходимо предоставить RustDesk разрешения \"Мониторинг ввода\"."),
|
||||
("config_microphone", ""),
|
||||
("request_elevation_tip", "Также можно запросить повышение прав, если кто-то есть на удалённой стороне."),
|
||||
("Wait", "Ждите"),
|
||||
("Elevation Error", "Ошибка повышения прав"),
|
||||
|
@ -415,6 +415,7 @@ pub static ref T: std::collections::HashMap<&'static str, &'static str> =
|
||||
("software_render_tip", ""),
|
||||
("Always use software rendering", ""),
|
||||
("config_input", ""),
|
||||
("config_microphone", ""),
|
||||
("request_elevation_tip", ""),
|
||||
("Wait", ""),
|
||||
("Elevation Error", ""),
|
||||
|
@ -415,6 +415,7 @@ pub static ref T: std::collections::HashMap<&'static str, &'static str> =
|
||||
("software_render_tip", ""),
|
||||
("Always use software rendering", ""),
|
||||
("config_input", ""),
|
||||
("config_microphone", ""),
|
||||
("request_elevation_tip", ""),
|
||||
("Wait", ""),
|
||||
("Elevation Error", ""),
|
||||
|
@ -415,6 +415,7 @@ pub static ref T: std::collections::HashMap<&'static str, &'static str> =
|
||||
("software_render_tip", ""),
|
||||
("Always use software rendering", ""),
|
||||
("config_input", ""),
|
||||
("config_microphone", ""),
|
||||
("request_elevation_tip", ""),
|
||||
("Wait", ""),
|
||||
("Elevation Error", ""),
|
||||
|
@ -415,6 +415,7 @@ pub static ref T: std::collections::HashMap<&'static str, &'static str> =
|
||||
("software_render_tip", ""),
|
||||
("Always use software rendering", ""),
|
||||
("config_input", ""),
|
||||
("config_microphone", ""),
|
||||
("request_elevation_tip", ""),
|
||||
("Wait", ""),
|
||||
("Elevation Error", ""),
|
||||
|
@ -415,6 +415,7 @@ pub static ref T: std::collections::HashMap<&'static str, &'static str> =
|
||||
("software_render_tip", ""),
|
||||
("Always use software rendering", ""),
|
||||
("config_input", ""),
|
||||
("config_microphone", ""),
|
||||
("request_elevation_tip", ""),
|
||||
("Wait", ""),
|
||||
("Elevation Error", ""),
|
||||
|
@ -415,6 +415,7 @@ pub static ref T: std::collections::HashMap<&'static str, &'static str> =
|
||||
("software_render_tip", ""),
|
||||
("Always use software rendering", ""),
|
||||
("config_input", ""),
|
||||
("config_microphone", ""),
|
||||
("request_elevation_tip", ""),
|
||||
("Wait", ""),
|
||||
("Elevation Error", ""),
|
||||
|
@ -415,6 +415,7 @@ pub static ref T: std::collections::HashMap<&'static str, &'static str> =
|
||||
("software_render_tip", ""),
|
||||
("Always use software rendering", ""),
|
||||
("config_input", ""),
|
||||
("config_microphone", ""),
|
||||
("request_elevation_tip", ""),
|
||||
("Wait", ""),
|
||||
("Elevation Error", ""),
|
||||
|
@ -415,6 +415,7 @@ pub static ref T: std::collections::HashMap<&'static str, &'static str> =
|
||||
("software_render_tip", ""),
|
||||
("Always use software rendering", ""),
|
||||
("config_input", ""),
|
||||
("config_microphone", ""),
|
||||
("request_elevation_tip", ""),
|
||||
("Wait", ""),
|
||||
("Elevation Error", ""),
|
||||
|
@ -415,6 +415,7 @@ pub static ref T: std::collections::HashMap<&'static str, &'static str> =
|
||||
("software_render_tip", "如果你使用英偉達顯卡, 並且遠程窗口在會話建立後會立刻關閉, 那麼安裝nouveau驅動並且選擇使用軟件渲染可能會有幫助。重啟軟件後生效。"),
|
||||
("Always use software rendering", "使用軟件渲染"),
|
||||
("config_input", ""),
|
||||
("config_microphone", ""),
|
||||
("request_elevation_tip", "如果對面有人, 也可以請求提升權限。"),
|
||||
("Wait", "等待"),
|
||||
("Elevation Error", "提權失敗"),
|
||||
|
@ -415,6 +415,7 @@ pub static ref T: std::collections::HashMap<&'static str, &'static str> =
|
||||
("software_render_tip", ""),
|
||||
("Always use software rendering", ""),
|
||||
("config_input", ""),
|
||||
("config_microphone", ""),
|
||||
("request_elevation_tip", ""),
|
||||
("Wait", ""),
|
||||
("Elevation Error", ""),
|
||||
|
@ -415,6 +415,7 @@ pub static ref T: std::collections::HashMap<&'static str, &'static str> =
|
||||
("software_render_tip", ""),
|
||||
("Always use software rendering", ""),
|
||||
("config_input", ""),
|
||||
("config_microphone", ""),
|
||||
("request_elevation_tip", ""),
|
||||
("Wait", ""),
|
||||
("Elevation Error", ""),
|
||||
|
Loading…
Reference in New Issue
Block a user