shift-shell/components/waydroidintegrationplugin/waydroiddbusobject.cpp

Ignoring revisions in .git-blame-ignore-revs. Click here to bypass and see the normal blame view.

682 lines
20 KiB
C++
Raw Normal View History

kcm: Implement minimal Waydroid support I prefer create MR now to avoid biggest merge request. It add minimalist implementation: - First configuration of Waydroid - Stop / Start Waydroid session - Configure properties of Waydroid - Display current ip of Waydroid | Not installed | First initialization | initializing | SessionNotStarted | SessionStarting | SessionStarted | | ------ | ------ | ------ | ------ | ------ | ------ | | ![Copie_d_écran_20250705_162112](/uploads/66844057ee6c955803288993809616fa/Copie_d_écran_20250705_162112.png) | ![Copie_d_écran_20250707_234822](/uploads/133779f8d4a70551a321938a7193aa3d/Copie_d_écran_20250707_234822.png) | ![Copie_d_écran_20250707_234829](/uploads/bacecd42875e3afd48dba2f9472b0f13/Copie_d_écran_20250707_234829.png) | ![Copie_d_écran_20250707_234908](/uploads/c6eff9833e33f30797088e327fcf6ea3/Copie_d_écran_20250707_234908.png) | ![Copie_d_écran_20250707_234919](/uploads/1927e2334d7e3b5790e5fab9037feff7/Copie_d_écran_20250707_234919.png) | ![Copie_d_écran_20250707_235239](/uploads/9be45b0a7b5f988de0e9ac297a2447c8/Copie_d_écran_20250707_235239.png) | Linked to https://invent.kde.org/teams/plasma-mobile/issues/-/issues/307 **Note for Reviewer**: In my local environment, i need to add manually the KAuth files otherwise polkit not recognize the implementation. ``` sudo cp ~/kde/usr/share/dbus-1/system-services/org.kde.plasma.mobileshell.waydroidhelper.service /usr/share/dbus-1/system-services/ sudo cp ~/kde/usr/share/dbus-1/system.d/org.kde.plasma.mobileshell.waydroidhelper.conf /usr/share/dbus-1/system.d/ sudo cp ~/kde/usr/share/polkit-1/actions/org.kde.plasma.mobileshell.waydroidhelper.policy /usr/share/polkit-1/actions/ ```
2025-07-10 16:00:41 +00:00
/*
* SPDX-FileCopyrightText: 2025 Florian RICHER <florian.richer@protonmail.com>
*
* SPDX-License-Identifier: GPL-2.0-or-later
*/
#include "waydroiddbusobject.h"
#include "waydroidadaptor.h"
#include "waydroidapplicationdbusobject.h"
kcm: Implement minimal Waydroid support I prefer create MR now to avoid biggest merge request. It add minimalist implementation: - First configuration of Waydroid - Stop / Start Waydroid session - Configure properties of Waydroid - Display current ip of Waydroid | Not installed | First initialization | initializing | SessionNotStarted | SessionStarting | SessionStarted | | ------ | ------ | ------ | ------ | ------ | ------ | | ![Copie_d_écran_20250705_162112](/uploads/66844057ee6c955803288993809616fa/Copie_d_écran_20250705_162112.png) | ![Copie_d_écran_20250707_234822](/uploads/133779f8d4a70551a321938a7193aa3d/Copie_d_écran_20250707_234822.png) | ![Copie_d_écran_20250707_234829](/uploads/bacecd42875e3afd48dba2f9472b0f13/Copie_d_écran_20250707_234829.png) | ![Copie_d_écran_20250707_234908](/uploads/c6eff9833e33f30797088e327fcf6ea3/Copie_d_écran_20250707_234908.png) | ![Copie_d_écran_20250707_234919](/uploads/1927e2334d7e3b5790e5fab9037feff7/Copie_d_écran_20250707_234919.png) | ![Copie_d_écran_20250707_235239](/uploads/9be45b0a7b5f988de0e9ac297a2447c8/Copie_d_écran_20250707_235239.png) | Linked to https://invent.kde.org/teams/plasma-mobile/issues/-/issues/307 **Note for Reviewer**: In my local environment, i need to add manually the KAuth files otherwise polkit not recognize the implementation. ``` sudo cp ~/kde/usr/share/dbus-1/system-services/org.kde.plasma.mobileshell.waydroidhelper.service /usr/share/dbus-1/system-services/ sudo cp ~/kde/usr/share/dbus-1/system.d/org.kde.plasma.mobileshell.waydroidhelper.conf /usr/share/dbus-1/system.d/ sudo cp ~/kde/usr/share/polkit-1/actions/org.kde.plasma.mobileshell.waydroidhelper.policy /usr/share/polkit-1/actions/ ```
2025-07-10 16:00:41 +00:00
#include "waydroidintegrationplugin_debug.h"
2025-07-14 10:47:21 +00:00
#include "waydroidshared.h"
kcm: Implement minimal Waydroid support I prefer create MR now to avoid biggest merge request. It add minimalist implementation: - First configuration of Waydroid - Stop / Start Waydroid session - Configure properties of Waydroid - Display current ip of Waydroid | Not installed | First initialization | initializing | SessionNotStarted | SessionStarting | SessionStarted | | ------ | ------ | ------ | ------ | ------ | ------ | | ![Copie_d_écran_20250705_162112](/uploads/66844057ee6c955803288993809616fa/Copie_d_écran_20250705_162112.png) | ![Copie_d_écran_20250707_234822](/uploads/133779f8d4a70551a321938a7193aa3d/Copie_d_écran_20250707_234822.png) | ![Copie_d_écran_20250707_234829](/uploads/bacecd42875e3afd48dba2f9472b0f13/Copie_d_écran_20250707_234829.png) | ![Copie_d_écran_20250707_234908](/uploads/c6eff9833e33f30797088e327fcf6ea3/Copie_d_écran_20250707_234908.png) | ![Copie_d_écran_20250707_234919](/uploads/1927e2334d7e3b5790e5fab9037feff7/Copie_d_écran_20250707_234919.png) | ![Copie_d_écran_20250707_235239](/uploads/9be45b0a7b5f988de0e9ac297a2447c8/Copie_d_écran_20250707_235239.png) | Linked to https://invent.kde.org/teams/plasma-mobile/issues/-/issues/307 **Note for Reviewer**: In my local environment, i need to add manually the KAuth files otherwise polkit not recognize the implementation. ``` sudo cp ~/kde/usr/share/dbus-1/system-services/org.kde.plasma.mobileshell.waydroidhelper.service /usr/share/dbus-1/system-services/ sudo cp ~/kde/usr/share/dbus-1/system.d/org.kde.plasma.mobileshell.waydroidhelper.conf /usr/share/dbus-1/system.d/ sudo cp ~/kde/usr/share/polkit-1/actions/org.kde.plasma.mobileshell.waydroidhelper.policy /usr/share/polkit-1/actions/ ```
2025-07-10 16:00:41 +00:00
#include <QDBusConnection>
#include <QDir>
#include <QLoggingCategory>
kcm: Implement minimal Waydroid support I prefer create MR now to avoid biggest merge request. It add minimalist implementation: - First configuration of Waydroid - Stop / Start Waydroid session - Configure properties of Waydroid - Display current ip of Waydroid | Not installed | First initialization | initializing | SessionNotStarted | SessionStarting | SessionStarted | | ------ | ------ | ------ | ------ | ------ | ------ | | ![Copie_d_écran_20250705_162112](/uploads/66844057ee6c955803288993809616fa/Copie_d_écran_20250705_162112.png) | ![Copie_d_écran_20250707_234822](/uploads/133779f8d4a70551a321938a7193aa3d/Copie_d_écran_20250707_234822.png) | ![Copie_d_écran_20250707_234829](/uploads/bacecd42875e3afd48dba2f9472b0f13/Copie_d_écran_20250707_234829.png) | ![Copie_d_écran_20250707_234908](/uploads/c6eff9833e33f30797088e327fcf6ea3/Copie_d_écran_20250707_234908.png) | ![Copie_d_écran_20250707_234919](/uploads/1927e2334d7e3b5790e5fab9037feff7/Copie_d_écran_20250707_234919.png) | ![Copie_d_écran_20250707_235239](/uploads/9be45b0a7b5f988de0e9ac297a2447c8/Copie_d_écran_20250707_235239.png) | Linked to https://invent.kde.org/teams/plasma-mobile/issues/-/issues/307 **Note for Reviewer**: In my local environment, i need to add manually the KAuth files otherwise polkit not recognize the implementation. ``` sudo cp ~/kde/usr/share/dbus-1/system-services/org.kde.plasma.mobileshell.waydroidhelper.service /usr/share/dbus-1/system-services/ sudo cp ~/kde/usr/share/dbus-1/system.d/org.kde.plasma.mobileshell.waydroidhelper.conf /usr/share/dbus-1/system.d/ sudo cp ~/kde/usr/share/polkit-1/actions/org.kde.plasma.mobileshell.waydroidhelper.policy /usr/share/polkit-1/actions/ ```
2025-07-10 16:00:41 +00:00
#include <QProcess>
#include <QRegularExpression>
2025-07-28 17:37:19 +00:00
#include <QStandardPaths>
kcm: Implement minimal Waydroid support I prefer create MR now to avoid biggest merge request. It add minimalist implementation: - First configuration of Waydroid - Stop / Start Waydroid session - Configure properties of Waydroid - Display current ip of Waydroid | Not installed | First initialization | initializing | SessionNotStarted | SessionStarting | SessionStarted | | ------ | ------ | ------ | ------ | ------ | ------ | | ![Copie_d_écran_20250705_162112](/uploads/66844057ee6c955803288993809616fa/Copie_d_écran_20250705_162112.png) | ![Copie_d_écran_20250707_234822](/uploads/133779f8d4a70551a321938a7193aa3d/Copie_d_écran_20250707_234822.png) | ![Copie_d_écran_20250707_234829](/uploads/bacecd42875e3afd48dba2f9472b0f13/Copie_d_écran_20250707_234829.png) | ![Copie_d_écran_20250707_234908](/uploads/c6eff9833e33f30797088e327fcf6ea3/Copie_d_écran_20250707_234908.png) | ![Copie_d_écran_20250707_234919](/uploads/1927e2334d7e3b5790e5fab9037feff7/Copie_d_écran_20250707_234919.png) | ![Copie_d_écran_20250707_235239](/uploads/9be45b0a7b5f988de0e9ac297a2447c8/Copie_d_écran_20250707_235239.png) | Linked to https://invent.kde.org/teams/plasma-mobile/issues/-/issues/307 **Note for Reviewer**: In my local environment, i need to add manually the KAuth files otherwise polkit not recognize the implementation. ``` sudo cp ~/kde/usr/share/dbus-1/system-services/org.kde.plasma.mobileshell.waydroidhelper.service /usr/share/dbus-1/system-services/ sudo cp ~/kde/usr/share/dbus-1/system.d/org.kde.plasma.mobileshell.waydroidhelper.conf /usr/share/dbus-1/system.d/ sudo cp ~/kde/usr/share/polkit-1/actions/org.kde.plasma.mobileshell.waydroidhelper.policy /usr/share/polkit-1/actions/ ```
2025-07-10 16:00:41 +00:00
#include <QTimer>
#include <KAuth/ExecuteJob>
2025-07-28 17:37:19 +00:00
#include <KConfigGroup>
#include <KDesktopFile>
kcm: Implement minimal Waydroid support I prefer create MR now to avoid biggest merge request. It add minimalist implementation: - First configuration of Waydroid - Stop / Start Waydroid session - Configure properties of Waydroid - Display current ip of Waydroid | Not installed | First initialization | initializing | SessionNotStarted | SessionStarting | SessionStarted | | ------ | ------ | ------ | ------ | ------ | ------ | | ![Copie_d_écran_20250705_162112](/uploads/66844057ee6c955803288993809616fa/Copie_d_écran_20250705_162112.png) | ![Copie_d_écran_20250707_234822](/uploads/133779f8d4a70551a321938a7193aa3d/Copie_d_écran_20250707_234822.png) | ![Copie_d_écran_20250707_234829](/uploads/bacecd42875e3afd48dba2f9472b0f13/Copie_d_écran_20250707_234829.png) | ![Copie_d_écran_20250707_234908](/uploads/c6eff9833e33f30797088e327fcf6ea3/Copie_d_écran_20250707_234908.png) | ![Copie_d_écran_20250707_234919](/uploads/1927e2334d7e3b5790e5fab9037feff7/Copie_d_écran_20250707_234919.png) | ![Copie_d_écran_20250707_235239](/uploads/9be45b0a7b5f988de0e9ac297a2447c8/Copie_d_écran_20250707_235239.png) | Linked to https://invent.kde.org/teams/plasma-mobile/issues/-/issues/307 **Note for Reviewer**: In my local environment, i need to add manually the KAuth files otherwise polkit not recognize the implementation. ``` sudo cp ~/kde/usr/share/dbus-1/system-services/org.kde.plasma.mobileshell.waydroidhelper.service /usr/share/dbus-1/system-services/ sudo cp ~/kde/usr/share/dbus-1/system.d/org.kde.plasma.mobileshell.waydroidhelper.conf /usr/share/dbus-1/system.d/ sudo cp ~/kde/usr/share/polkit-1/actions/org.kde.plasma.mobileshell.waydroidhelper.policy /usr/share/polkit-1/actions/ ```
2025-07-10 16:00:41 +00:00
#include <KLocalizedString>
2025-07-28 17:37:19 +00:00
#include <KSandbox>
kcm: Implement minimal Waydroid support I prefer create MR now to avoid biggest merge request. It add minimalist implementation: - First configuration of Waydroid - Stop / Start Waydroid session - Configure properties of Waydroid - Display current ip of Waydroid | Not installed | First initialization | initializing | SessionNotStarted | SessionStarting | SessionStarted | | ------ | ------ | ------ | ------ | ------ | ------ | | ![Copie_d_écran_20250705_162112](/uploads/66844057ee6c955803288993809616fa/Copie_d_écran_20250705_162112.png) | ![Copie_d_écran_20250707_234822](/uploads/133779f8d4a70551a321938a7193aa3d/Copie_d_écran_20250707_234822.png) | ![Copie_d_écran_20250707_234829](/uploads/bacecd42875e3afd48dba2f9472b0f13/Copie_d_écran_20250707_234829.png) | ![Copie_d_écran_20250707_234908](/uploads/c6eff9833e33f30797088e327fcf6ea3/Copie_d_écran_20250707_234908.png) | ![Copie_d_écran_20250707_234919](/uploads/1927e2334d7e3b5790e5fab9037feff7/Copie_d_écran_20250707_234919.png) | ![Copie_d_écran_20250707_235239](/uploads/9be45b0a7b5f988de0e9ac297a2447c8/Copie_d_écran_20250707_235239.png) | Linked to https://invent.kde.org/teams/plasma-mobile/issues/-/issues/307 **Note for Reviewer**: In my local environment, i need to add manually the KAuth files otherwise polkit not recognize the implementation. ``` sudo cp ~/kde/usr/share/dbus-1/system-services/org.kde.plasma.mobileshell.waydroidhelper.service /usr/share/dbus-1/system-services/ sudo cp ~/kde/usr/share/dbus-1/system.d/org.kde.plasma.mobileshell.waydroidhelper.conf /usr/share/dbus-1/system.d/ sudo cp ~/kde/usr/share/polkit-1/actions/org.kde.plasma.mobileshell.waydroidhelper.policy /usr/share/polkit-1/actions/ ```
2025-07-10 16:00:41 +00:00
using namespace Qt::StringLiterals;
#define MULTI_WINDOWS_PROP_KEY "persist.waydroid.multi_windows"
#define SUSPEND_PROP_KEY "persist.waydroid.suspend"
#define UEVENT_PROP_KEY "persist.waydroid.uevent"
static const QRegularExpression sessionRegExp(u"Session:\\s*(\\w+)"_s);
static const QRegularExpression ipAdressRegExp(u"IP address:\\s*(\\d+\\.\\d+\\.\\d+\\.\\d+)"_s);
static const QRegularExpression systemOtaRegExp(u"system_ota\\s*=\\s*(\\S+)"_s);
kcm: Implement minimal Waydroid support I prefer create MR now to avoid biggest merge request. It add minimalist implementation: - First configuration of Waydroid - Stop / Start Waydroid session - Configure properties of Waydroid - Display current ip of Waydroid | Not installed | First initialization | initializing | SessionNotStarted | SessionStarting | SessionStarted | | ------ | ------ | ------ | ------ | ------ | ------ | | ![Copie_d_écran_20250705_162112](/uploads/66844057ee6c955803288993809616fa/Copie_d_écran_20250705_162112.png) | ![Copie_d_écran_20250707_234822](/uploads/133779f8d4a70551a321938a7193aa3d/Copie_d_écran_20250707_234822.png) | ![Copie_d_écran_20250707_234829](/uploads/bacecd42875e3afd48dba2f9472b0f13/Copie_d_écran_20250707_234829.png) | ![Copie_d_écran_20250707_234908](/uploads/c6eff9833e33f30797088e327fcf6ea3/Copie_d_écran_20250707_234908.png) | ![Copie_d_écran_20250707_234919](/uploads/1927e2334d7e3b5790e5fab9037feff7/Copie_d_écran_20250707_234919.png) | ![Copie_d_écran_20250707_235239](/uploads/9be45b0a7b5f988de0e9ac297a2447c8/Copie_d_écran_20250707_235239.png) | Linked to https://invent.kde.org/teams/plasma-mobile/issues/-/issues/307 **Note for Reviewer**: In my local environment, i need to add manually the KAuth files otherwise polkit not recognize the implementation. ``` sudo cp ~/kde/usr/share/dbus-1/system-services/org.kde.plasma.mobileshell.waydroidhelper.service /usr/share/dbus-1/system-services/ sudo cp ~/kde/usr/share/dbus-1/system.d/org.kde.plasma.mobileshell.waydroidhelper.conf /usr/share/dbus-1/system.d/ sudo cp ~/kde/usr/share/polkit-1/actions/org.kde.plasma.mobileshell.waydroidhelper.policy /usr/share/polkit-1/actions/ ```
2025-07-10 16:00:41 +00:00
WaydroidDBusObject::WaydroidDBusObject(QObject *parent)
kcm: Implement minimal Waydroid support I prefer create MR now to avoid biggest merge request. It add minimalist implementation: - First configuration of Waydroid - Stop / Start Waydroid session - Configure properties of Waydroid - Display current ip of Waydroid | Not installed | First initialization | initializing | SessionNotStarted | SessionStarting | SessionStarted | | ------ | ------ | ------ | ------ | ------ | ------ | | ![Copie_d_écran_20250705_162112](/uploads/66844057ee6c955803288993809616fa/Copie_d_écran_20250705_162112.png) | ![Copie_d_écran_20250707_234822](/uploads/133779f8d4a70551a321938a7193aa3d/Copie_d_écran_20250707_234822.png) | ![Copie_d_écran_20250707_234829](/uploads/bacecd42875e3afd48dba2f9472b0f13/Copie_d_écran_20250707_234829.png) | ![Copie_d_écran_20250707_234908](/uploads/c6eff9833e33f30797088e327fcf6ea3/Copie_d_écran_20250707_234908.png) | ![Copie_d_écran_20250707_234919](/uploads/1927e2334d7e3b5790e5fab9037feff7/Copie_d_écran_20250707_234919.png) | ![Copie_d_écran_20250707_235239](/uploads/9be45b0a7b5f988de0e9ac297a2447c8/Copie_d_écran_20250707_235239.png) | Linked to https://invent.kde.org/teams/plasma-mobile/issues/-/issues/307 **Note for Reviewer**: In my local environment, i need to add manually the KAuth files otherwise polkit not recognize the implementation. ``` sudo cp ~/kde/usr/share/dbus-1/system-services/org.kde.plasma.mobileshell.waydroidhelper.service /usr/share/dbus-1/system-services/ sudo cp ~/kde/usr/share/dbus-1/system.d/org.kde.plasma.mobileshell.waydroidhelper.conf /usr/share/dbus-1/system.d/ sudo cp ~/kde/usr/share/polkit-1/actions/org.kde.plasma.mobileshell.waydroidhelper.policy /usr/share/polkit-1/actions/ ```
2025-07-10 16:00:41 +00:00
: QObject{parent}
{
2025-07-10 16:57:34 +00:00
}
void WaydroidDBusObject::registerObject()
kcm: Implement minimal Waydroid support I prefer create MR now to avoid biggest merge request. It add minimalist implementation: - First configuration of Waydroid - Stop / Start Waydroid session - Configure properties of Waydroid - Display current ip of Waydroid | Not installed | First initialization | initializing | SessionNotStarted | SessionStarting | SessionStarted | | ------ | ------ | ------ | ------ | ------ | ------ | | ![Copie_d_écran_20250705_162112](/uploads/66844057ee6c955803288993809616fa/Copie_d_écran_20250705_162112.png) | ![Copie_d_écran_20250707_234822](/uploads/133779f8d4a70551a321938a7193aa3d/Copie_d_écran_20250707_234822.png) | ![Copie_d_écran_20250707_234829](/uploads/bacecd42875e3afd48dba2f9472b0f13/Copie_d_écran_20250707_234829.png) | ![Copie_d_écran_20250707_234908](/uploads/c6eff9833e33f30797088e327fcf6ea3/Copie_d_écran_20250707_234908.png) | ![Copie_d_écran_20250707_234919](/uploads/1927e2334d7e3b5790e5fab9037feff7/Copie_d_écran_20250707_234919.png) | ![Copie_d_écran_20250707_235239](/uploads/9be45b0a7b5f988de0e9ac297a2447c8/Copie_d_écran_20250707_235239.png) | Linked to https://invent.kde.org/teams/plasma-mobile/issues/-/issues/307 **Note for Reviewer**: In my local environment, i need to add manually the KAuth files otherwise polkit not recognize the implementation. ``` sudo cp ~/kde/usr/share/dbus-1/system-services/org.kde.plasma.mobileshell.waydroidhelper.service /usr/share/dbus-1/system-services/ sudo cp ~/kde/usr/share/dbus-1/system.d/org.kde.plasma.mobileshell.waydroidhelper.conf /usr/share/dbus-1/system.d/ sudo cp ~/kde/usr/share/polkit-1/actions/org.kde.plasma.mobileshell.waydroidhelper.policy /usr/share/polkit-1/actions/ ```
2025-07-10 16:00:41 +00:00
{
if (!m_dbusInitialized) {
new WaydroidAdaptor{this};
QDBusConnection::sessionBus().registerObject(u"/Waydroid"_s, this);
m_dbusInitialized = true;
kcm: Implement minimal Waydroid support I prefer create MR now to avoid biggest merge request. It add minimalist implementation: - First configuration of Waydroid - Stop / Start Waydroid session - Configure properties of Waydroid - Display current ip of Waydroid | Not installed | First initialization | initializing | SessionNotStarted | SessionStarting | SessionStarted | | ------ | ------ | ------ | ------ | ------ | ------ | | ![Copie_d_écran_20250705_162112](/uploads/66844057ee6c955803288993809616fa/Copie_d_écran_20250705_162112.png) | ![Copie_d_écran_20250707_234822](/uploads/133779f8d4a70551a321938a7193aa3d/Copie_d_écran_20250707_234822.png) | ![Copie_d_écran_20250707_234829](/uploads/bacecd42875e3afd48dba2f9472b0f13/Copie_d_écran_20250707_234829.png) | ![Copie_d_écran_20250707_234908](/uploads/c6eff9833e33f30797088e327fcf6ea3/Copie_d_écran_20250707_234908.png) | ![Copie_d_écran_20250707_234919](/uploads/1927e2334d7e3b5790e5fab9037feff7/Copie_d_écran_20250707_234919.png) | ![Copie_d_écran_20250707_235239](/uploads/9be45b0a7b5f988de0e9ac297a2447c8/Copie_d_écran_20250707_235239.png) | Linked to https://invent.kde.org/teams/plasma-mobile/issues/-/issues/307 **Note for Reviewer**: In my local environment, i need to add manually the KAuth files otherwise polkit not recognize the implementation. ``` sudo cp ~/kde/usr/share/dbus-1/system-services/org.kde.plasma.mobileshell.waydroidhelper.service /usr/share/dbus-1/system-services/ sudo cp ~/kde/usr/share/dbus-1/system.d/org.kde.plasma.mobileshell.waydroidhelper.conf /usr/share/dbus-1/system.d/ sudo cp ~/kde/usr/share/polkit-1/actions/org.kde.plasma.mobileshell.waydroidhelper.policy /usr/share/polkit-1/actions/ ```
2025-07-10 16:00:41 +00:00
// Connect it-self to auto-refresh when required status has changed
connect(this, &WaydroidDBusObject::statusChanged, this, &WaydroidDBusObject::refreshSessionInfo);
connect(this, &WaydroidDBusObject::statusChanged, this, &WaydroidDBusObject::refreshInstallationInfo);
connect(this, &WaydroidDBusObject::sessionStatusChanged, this, &WaydroidDBusObject::refreshPropsInfo);
connect(this, &WaydroidDBusObject::sessionStatusChanged, this, &WaydroidDBusObject::refreshApplications);
kcm: Implement minimal Waydroid support I prefer create MR now to avoid biggest merge request. It add minimalist implementation: - First configuration of Waydroid - Stop / Start Waydroid session - Configure properties of Waydroid - Display current ip of Waydroid | Not installed | First initialization | initializing | SessionNotStarted | SessionStarting | SessionStarted | | ------ | ------ | ------ | ------ | ------ | ------ | | ![Copie_d_écran_20250705_162112](/uploads/66844057ee6c955803288993809616fa/Copie_d_écran_20250705_162112.png) | ![Copie_d_écran_20250707_234822](/uploads/133779f8d4a70551a321938a7193aa3d/Copie_d_écran_20250707_234822.png) | ![Copie_d_écran_20250707_234829](/uploads/bacecd42875e3afd48dba2f9472b0f13/Copie_d_écran_20250707_234829.png) | ![Copie_d_écran_20250707_234908](/uploads/c6eff9833e33f30797088e327fcf6ea3/Copie_d_écran_20250707_234908.png) | ![Copie_d_écran_20250707_234919](/uploads/1927e2334d7e3b5790e5fab9037feff7/Copie_d_écran_20250707_234919.png) | ![Copie_d_écran_20250707_235239](/uploads/9be45b0a7b5f988de0e9ac297a2447c8/Copie_d_écran_20250707_235239.png) | Linked to https://invent.kde.org/teams/plasma-mobile/issues/-/issues/307 **Note for Reviewer**: In my local environment, i need to add manually the KAuth files otherwise polkit not recognize the implementation. ``` sudo cp ~/kde/usr/share/dbus-1/system-services/org.kde.plasma.mobileshell.waydroidhelper.service /usr/share/dbus-1/system-services/ sudo cp ~/kde/usr/share/dbus-1/system.d/org.kde.plasma.mobileshell.waydroidhelper.conf /usr/share/dbus-1/system.d/ sudo cp ~/kde/usr/share/polkit-1/actions/org.kde.plasma.mobileshell.waydroidhelper.policy /usr/share/polkit-1/actions/ ```
2025-07-10 16:00:41 +00:00
refreshSupportsInfo();
kcm: Implement minimal Waydroid support I prefer create MR now to avoid biggest merge request. It add minimalist implementation: - First configuration of Waydroid - Stop / Start Waydroid session - Configure properties of Waydroid - Display current ip of Waydroid | Not installed | First initialization | initializing | SessionNotStarted | SessionStarting | SessionStarted | | ------ | ------ | ------ | ------ | ------ | ------ | | ![Copie_d_écran_20250705_162112](/uploads/66844057ee6c955803288993809616fa/Copie_d_écran_20250705_162112.png) | ![Copie_d_écran_20250707_234822](/uploads/133779f8d4a70551a321938a7193aa3d/Copie_d_écran_20250707_234822.png) | ![Copie_d_écran_20250707_234829](/uploads/bacecd42875e3afd48dba2f9472b0f13/Copie_d_écran_20250707_234829.png) | ![Copie_d_écran_20250707_234908](/uploads/c6eff9833e33f30797088e327fcf6ea3/Copie_d_écran_20250707_234908.png) | ![Copie_d_écran_20250707_234919](/uploads/1927e2334d7e3b5790e5fab9037feff7/Copie_d_écran_20250707_234919.png) | ![Copie_d_écran_20250707_235239](/uploads/9be45b0a7b5f988de0e9ac297a2447c8/Copie_d_écran_20250707_235239.png) | Linked to https://invent.kde.org/teams/plasma-mobile/issues/-/issues/307 **Note for Reviewer**: In my local environment, i need to add manually the KAuth files otherwise polkit not recognize the implementation. ``` sudo cp ~/kde/usr/share/dbus-1/system-services/org.kde.plasma.mobileshell.waydroidhelper.service /usr/share/dbus-1/system-services/ sudo cp ~/kde/usr/share/dbus-1/system.d/org.kde.plasma.mobileshell.waydroidhelper.conf /usr/share/dbus-1/system.d/ sudo cp ~/kde/usr/share/polkit-1/actions/org.kde.plasma.mobileshell.waydroidhelper.policy /usr/share/polkit-1/actions/ ```
2025-07-10 16:00:41 +00:00
}
}
void WaydroidDBusObject::initialize(const int systemType, const int romType, const bool forced)
kcm: Implement minimal Waydroid support I prefer create MR now to avoid biggest merge request. It add minimalist implementation: - First configuration of Waydroid - Stop / Start Waydroid session - Configure properties of Waydroid - Display current ip of Waydroid | Not installed | First initialization | initializing | SessionNotStarted | SessionStarting | SessionStarted | | ------ | ------ | ------ | ------ | ------ | ------ | | ![Copie_d_écran_20250705_162112](/uploads/66844057ee6c955803288993809616fa/Copie_d_écran_20250705_162112.png) | ![Copie_d_écran_20250707_234822](/uploads/133779f8d4a70551a321938a7193aa3d/Copie_d_écran_20250707_234822.png) | ![Copie_d_écran_20250707_234829](/uploads/bacecd42875e3afd48dba2f9472b0f13/Copie_d_écran_20250707_234829.png) | ![Copie_d_écran_20250707_234908](/uploads/c6eff9833e33f30797088e327fcf6ea3/Copie_d_écran_20250707_234908.png) | ![Copie_d_écran_20250707_234919](/uploads/1927e2334d7e3b5790e5fab9037feff7/Copie_d_écran_20250707_234919.png) | ![Copie_d_écran_20250707_235239](/uploads/9be45b0a7b5f988de0e9ac297a2447c8/Copie_d_écran_20250707_235239.png) | Linked to https://invent.kde.org/teams/plasma-mobile/issues/-/issues/307 **Note for Reviewer**: In my local environment, i need to add manually the KAuth files otherwise polkit not recognize the implementation. ``` sudo cp ~/kde/usr/share/dbus-1/system-services/org.kde.plasma.mobileshell.waydroidhelper.service /usr/share/dbus-1/system-services/ sudo cp ~/kde/usr/share/dbus-1/system.d/org.kde.plasma.mobileshell.waydroidhelper.conf /usr/share/dbus-1/system.d/ sudo cp ~/kde/usr/share/polkit-1/actions/org.kde.plasma.mobileshell.waydroidhelper.policy /usr/share/polkit-1/actions/ ```
2025-07-10 16:00:41 +00:00
{
if (m_status == Initializing) {
return;
kcm: Implement minimal Waydroid support I prefer create MR now to avoid biggest merge request. It add minimalist implementation: - First configuration of Waydroid - Stop / Start Waydroid session - Configure properties of Waydroid - Display current ip of Waydroid | Not installed | First initialization | initializing | SessionNotStarted | SessionStarting | SessionStarted | | ------ | ------ | ------ | ------ | ------ | ------ | | ![Copie_d_écran_20250705_162112](/uploads/66844057ee6c955803288993809616fa/Copie_d_écran_20250705_162112.png) | ![Copie_d_écran_20250707_234822](/uploads/133779f8d4a70551a321938a7193aa3d/Copie_d_écran_20250707_234822.png) | ![Copie_d_écran_20250707_234829](/uploads/bacecd42875e3afd48dba2f9472b0f13/Copie_d_écran_20250707_234829.png) | ![Copie_d_écran_20250707_234908](/uploads/c6eff9833e33f30797088e327fcf6ea3/Copie_d_écran_20250707_234908.png) | ![Copie_d_écran_20250707_234919](/uploads/1927e2334d7e3b5790e5fab9037feff7/Copie_d_écran_20250707_234919.png) | ![Copie_d_écran_20250707_235239](/uploads/9be45b0a7b5f988de0e9ac297a2447c8/Copie_d_écran_20250707_235239.png) | Linked to https://invent.kde.org/teams/plasma-mobile/issues/-/issues/307 **Note for Reviewer**: In my local environment, i need to add manually the KAuth files otherwise polkit not recognize the implementation. ``` sudo cp ~/kde/usr/share/dbus-1/system-services/org.kde.plasma.mobileshell.waydroidhelper.service /usr/share/dbus-1/system-services/ sudo cp ~/kde/usr/share/dbus-1/system.d/org.kde.plasma.mobileshell.waydroidhelper.conf /usr/share/dbus-1/system.d/ sudo cp ~/kde/usr/share/polkit-1/actions/org.kde.plasma.mobileshell.waydroidhelper.policy /usr/share/polkit-1/actions/ ```
2025-07-10 16:00:41 +00:00
}
m_status = Initializing;
Q_EMIT statusChanged();
QString systemTypeArg;
switch (systemType) {
case Vanilla:
kcm: Implement minimal Waydroid support I prefer create MR now to avoid biggest merge request. It add minimalist implementation: - First configuration of Waydroid - Stop / Start Waydroid session - Configure properties of Waydroid - Display current ip of Waydroid | Not installed | First initialization | initializing | SessionNotStarted | SessionStarting | SessionStarted | | ------ | ------ | ------ | ------ | ------ | ------ | | ![Copie_d_écran_20250705_162112](/uploads/66844057ee6c955803288993809616fa/Copie_d_écran_20250705_162112.png) | ![Copie_d_écran_20250707_234822](/uploads/133779f8d4a70551a321938a7193aa3d/Copie_d_écran_20250707_234822.png) | ![Copie_d_écran_20250707_234829](/uploads/bacecd42875e3afd48dba2f9472b0f13/Copie_d_écran_20250707_234829.png) | ![Copie_d_écran_20250707_234908](/uploads/c6eff9833e33f30797088e327fcf6ea3/Copie_d_écran_20250707_234908.png) | ![Copie_d_écran_20250707_234919](/uploads/1927e2334d7e3b5790e5fab9037feff7/Copie_d_écran_20250707_234919.png) | ![Copie_d_écran_20250707_235239](/uploads/9be45b0a7b5f988de0e9ac297a2447c8/Copie_d_écran_20250707_235239.png) | Linked to https://invent.kde.org/teams/plasma-mobile/issues/-/issues/307 **Note for Reviewer**: In my local environment, i need to add manually the KAuth files otherwise polkit not recognize the implementation. ``` sudo cp ~/kde/usr/share/dbus-1/system-services/org.kde.plasma.mobileshell.waydroidhelper.service /usr/share/dbus-1/system-services/ sudo cp ~/kde/usr/share/dbus-1/system.d/org.kde.plasma.mobileshell.waydroidhelper.conf /usr/share/dbus-1/system.d/ sudo cp ~/kde/usr/share/polkit-1/actions/org.kde.plasma.mobileshell.waydroidhelper.policy /usr/share/polkit-1/actions/ ```
2025-07-10 16:00:41 +00:00
systemTypeArg = "VANILLA";
break;
case Foss:
kcm: Implement minimal Waydroid support I prefer create MR now to avoid biggest merge request. It add minimalist implementation: - First configuration of Waydroid - Stop / Start Waydroid session - Configure properties of Waydroid - Display current ip of Waydroid | Not installed | First initialization | initializing | SessionNotStarted | SessionStarting | SessionStarted | | ------ | ------ | ------ | ------ | ------ | ------ | | ![Copie_d_écran_20250705_162112](/uploads/66844057ee6c955803288993809616fa/Copie_d_écran_20250705_162112.png) | ![Copie_d_écran_20250707_234822](/uploads/133779f8d4a70551a321938a7193aa3d/Copie_d_écran_20250707_234822.png) | ![Copie_d_écran_20250707_234829](/uploads/bacecd42875e3afd48dba2f9472b0f13/Copie_d_écran_20250707_234829.png) | ![Copie_d_écran_20250707_234908](/uploads/c6eff9833e33f30797088e327fcf6ea3/Copie_d_écran_20250707_234908.png) | ![Copie_d_écran_20250707_234919](/uploads/1927e2334d7e3b5790e5fab9037feff7/Copie_d_écran_20250707_234919.png) | ![Copie_d_écran_20250707_235239](/uploads/9be45b0a7b5f988de0e9ac297a2447c8/Copie_d_écran_20250707_235239.png) | Linked to https://invent.kde.org/teams/plasma-mobile/issues/-/issues/307 **Note for Reviewer**: In my local environment, i need to add manually the KAuth files otherwise polkit not recognize the implementation. ``` sudo cp ~/kde/usr/share/dbus-1/system-services/org.kde.plasma.mobileshell.waydroidhelper.service /usr/share/dbus-1/system-services/ sudo cp ~/kde/usr/share/dbus-1/system.d/org.kde.plasma.mobileshell.waydroidhelper.conf /usr/share/dbus-1/system.d/ sudo cp ~/kde/usr/share/polkit-1/actions/org.kde.plasma.mobileshell.waydroidhelper.policy /usr/share/polkit-1/actions/ ```
2025-07-10 16:00:41 +00:00
systemTypeArg = "FOSS";
break;
case Gapps:
kcm: Implement minimal Waydroid support I prefer create MR now to avoid biggest merge request. It add minimalist implementation: - First configuration of Waydroid - Stop / Start Waydroid session - Configure properties of Waydroid - Display current ip of Waydroid | Not installed | First initialization | initializing | SessionNotStarted | SessionStarting | SessionStarted | | ------ | ------ | ------ | ------ | ------ | ------ | | ![Copie_d_écran_20250705_162112](/uploads/66844057ee6c955803288993809616fa/Copie_d_écran_20250705_162112.png) | ![Copie_d_écran_20250707_234822](/uploads/133779f8d4a70551a321938a7193aa3d/Copie_d_écran_20250707_234822.png) | ![Copie_d_écran_20250707_234829](/uploads/bacecd42875e3afd48dba2f9472b0f13/Copie_d_écran_20250707_234829.png) | ![Copie_d_écran_20250707_234908](/uploads/c6eff9833e33f30797088e327fcf6ea3/Copie_d_écran_20250707_234908.png) | ![Copie_d_écran_20250707_234919](/uploads/1927e2334d7e3b5790e5fab9037feff7/Copie_d_écran_20250707_234919.png) | ![Copie_d_écran_20250707_235239](/uploads/9be45b0a7b5f988de0e9ac297a2447c8/Copie_d_écran_20250707_235239.png) | Linked to https://invent.kde.org/teams/plasma-mobile/issues/-/issues/307 **Note for Reviewer**: In my local environment, i need to add manually the KAuth files otherwise polkit not recognize the implementation. ``` sudo cp ~/kde/usr/share/dbus-1/system-services/org.kde.plasma.mobileshell.waydroidhelper.service /usr/share/dbus-1/system-services/ sudo cp ~/kde/usr/share/dbus-1/system.d/org.kde.plasma.mobileshell.waydroidhelper.conf /usr/share/dbus-1/system.d/ sudo cp ~/kde/usr/share/polkit-1/actions/org.kde.plasma.mobileshell.waydroidhelper.policy /usr/share/polkit-1/actions/ ```
2025-07-10 16:00:41 +00:00
systemTypeArg = "GAPPS";
break;
default:
systemTypeArg = "VANILLA";
break;
kcm: Implement minimal Waydroid support I prefer create MR now to avoid biggest merge request. It add minimalist implementation: - First configuration of Waydroid - Stop / Start Waydroid session - Configure properties of Waydroid - Display current ip of Waydroid | Not installed | First initialization | initializing | SessionNotStarted | SessionStarting | SessionStarted | | ------ | ------ | ------ | ------ | ------ | ------ | | ![Copie_d_écran_20250705_162112](/uploads/66844057ee6c955803288993809616fa/Copie_d_écran_20250705_162112.png) | ![Copie_d_écran_20250707_234822](/uploads/133779f8d4a70551a321938a7193aa3d/Copie_d_écran_20250707_234822.png) | ![Copie_d_écran_20250707_234829](/uploads/bacecd42875e3afd48dba2f9472b0f13/Copie_d_écran_20250707_234829.png) | ![Copie_d_écran_20250707_234908](/uploads/c6eff9833e33f30797088e327fcf6ea3/Copie_d_écran_20250707_234908.png) | ![Copie_d_écran_20250707_234919](/uploads/1927e2334d7e3b5790e5fab9037feff7/Copie_d_écran_20250707_234919.png) | ![Copie_d_écran_20250707_235239](/uploads/9be45b0a7b5f988de0e9ac297a2447c8/Copie_d_écran_20250707_235239.png) | Linked to https://invent.kde.org/teams/plasma-mobile/issues/-/issues/307 **Note for Reviewer**: In my local environment, i need to add manually the KAuth files otherwise polkit not recognize the implementation. ``` sudo cp ~/kde/usr/share/dbus-1/system-services/org.kde.plasma.mobileshell.waydroidhelper.service /usr/share/dbus-1/system-services/ sudo cp ~/kde/usr/share/dbus-1/system.d/org.kde.plasma.mobileshell.waydroidhelper.conf /usr/share/dbus-1/system.d/ sudo cp ~/kde/usr/share/polkit-1/actions/org.kde.plasma.mobileshell.waydroidhelper.policy /usr/share/polkit-1/actions/ ```
2025-07-10 16:00:41 +00:00
}
QString romTypeArg;
switch (romType) {
case Lineage:
kcm: Implement minimal Waydroid support I prefer create MR now to avoid biggest merge request. It add minimalist implementation: - First configuration of Waydroid - Stop / Start Waydroid session - Configure properties of Waydroid - Display current ip of Waydroid | Not installed | First initialization | initializing | SessionNotStarted | SessionStarting | SessionStarted | | ------ | ------ | ------ | ------ | ------ | ------ | | ![Copie_d_écran_20250705_162112](/uploads/66844057ee6c955803288993809616fa/Copie_d_écran_20250705_162112.png) | ![Copie_d_écran_20250707_234822](/uploads/133779f8d4a70551a321938a7193aa3d/Copie_d_écran_20250707_234822.png) | ![Copie_d_écran_20250707_234829](/uploads/bacecd42875e3afd48dba2f9472b0f13/Copie_d_écran_20250707_234829.png) | ![Copie_d_écran_20250707_234908](/uploads/c6eff9833e33f30797088e327fcf6ea3/Copie_d_écran_20250707_234908.png) | ![Copie_d_écran_20250707_234919](/uploads/1927e2334d7e3b5790e5fab9037feff7/Copie_d_écran_20250707_234919.png) | ![Copie_d_écran_20250707_235239](/uploads/9be45b0a7b5f988de0e9ac297a2447c8/Copie_d_écran_20250707_235239.png) | Linked to https://invent.kde.org/teams/plasma-mobile/issues/-/issues/307 **Note for Reviewer**: In my local environment, i need to add manually the KAuth files otherwise polkit not recognize the implementation. ``` sudo cp ~/kde/usr/share/dbus-1/system-services/org.kde.plasma.mobileshell.waydroidhelper.service /usr/share/dbus-1/system-services/ sudo cp ~/kde/usr/share/dbus-1/system.d/org.kde.plasma.mobileshell.waydroidhelper.conf /usr/share/dbus-1/system.d/ sudo cp ~/kde/usr/share/polkit-1/actions/org.kde.plasma.mobileshell.waydroidhelper.policy /usr/share/polkit-1/actions/ ```
2025-07-10 16:00:41 +00:00
romTypeArg = "lineage";
break;
case Bliss:
kcm: Implement minimal Waydroid support I prefer create MR now to avoid biggest merge request. It add minimalist implementation: - First configuration of Waydroid - Stop / Start Waydroid session - Configure properties of Waydroid - Display current ip of Waydroid | Not installed | First initialization | initializing | SessionNotStarted | SessionStarting | SessionStarted | | ------ | ------ | ------ | ------ | ------ | ------ | | ![Copie_d_écran_20250705_162112](/uploads/66844057ee6c955803288993809616fa/Copie_d_écran_20250705_162112.png) | ![Copie_d_écran_20250707_234822](/uploads/133779f8d4a70551a321938a7193aa3d/Copie_d_écran_20250707_234822.png) | ![Copie_d_écran_20250707_234829](/uploads/bacecd42875e3afd48dba2f9472b0f13/Copie_d_écran_20250707_234829.png) | ![Copie_d_écran_20250707_234908](/uploads/c6eff9833e33f30797088e327fcf6ea3/Copie_d_écran_20250707_234908.png) | ![Copie_d_écran_20250707_234919](/uploads/1927e2334d7e3b5790e5fab9037feff7/Copie_d_écran_20250707_234919.png) | ![Copie_d_écran_20250707_235239](/uploads/9be45b0a7b5f988de0e9ac297a2447c8/Copie_d_écran_20250707_235239.png) | Linked to https://invent.kde.org/teams/plasma-mobile/issues/-/issues/307 **Note for Reviewer**: In my local environment, i need to add manually the KAuth files otherwise polkit not recognize the implementation. ``` sudo cp ~/kde/usr/share/dbus-1/system-services/org.kde.plasma.mobileshell.waydroidhelper.service /usr/share/dbus-1/system-services/ sudo cp ~/kde/usr/share/dbus-1/system.d/org.kde.plasma.mobileshell.waydroidhelper.conf /usr/share/dbus-1/system.d/ sudo cp ~/kde/usr/share/polkit-1/actions/org.kde.plasma.mobileshell.waydroidhelper.policy /usr/share/polkit-1/actions/ ```
2025-07-10 16:00:41 +00:00
romTypeArg = "bliss";
break;
}
const QVariantMap args = {{u"systemType"_s, systemTypeArg}, {u"romType"_s, romTypeArg}, {u"forced"_s, forced}};
KAuth::Action writeAction(u"org.kde.plasma.mobileshell.waydroidhelper.initialize"_s);
writeAction.setHelperId(u"org.kde.plasma.mobileshell.waydroidhelper"_s);
writeAction.setArguments(args);
writeAction.setTimeout(3600000); // HACK: 1 hour to wait installation
KAuth::ExecuteJob *job = writeAction.execute();
job->start();
2025-07-26 17:32:26 +00:00
connect(job, &KAuth::ExecuteJob::newData, this, [this](const QVariantMap &data) {
QString log = data.value("log", "").toString();
float downloaded = data.value("downloaded", 0.0).toFloat();
float total = data.value("total", 0.0).toFloat();
float speed = data.value("speed", 0.0).toFloat();
qCDebug(WAYDROIDINTEGRATIONPLUGIN) << "log: " << log;
Q_EMIT downloadStatusChanged(downloaded, total, speed);
});
connect(job, &KAuth::ExecuteJob::finished, this, [this](KJob *job, auto) {
if (job->error() == 0) {
m_status = Initialized;
} else {
Q_EMIT errorOccurred(i18n("Failed to initialize Waydroid."), job->errorString());
2025-07-28 17:20:33 +00:00
m_status = NotInitialized;
qCWarning(WAYDROIDINTEGRATIONPLUGIN) << "KAuth returned an error code:" << job->error() << " message: " << job->errorString();
}
2025-07-28 17:20:33 +00:00
Q_EMIT statusChanged();
});
kcm: Implement minimal Waydroid support I prefer create MR now to avoid biggest merge request. It add minimalist implementation: - First configuration of Waydroid - Stop / Start Waydroid session - Configure properties of Waydroid - Display current ip of Waydroid | Not installed | First initialization | initializing | SessionNotStarted | SessionStarting | SessionStarted | | ------ | ------ | ------ | ------ | ------ | ------ | | ![Copie_d_écran_20250705_162112](/uploads/66844057ee6c955803288993809616fa/Copie_d_écran_20250705_162112.png) | ![Copie_d_écran_20250707_234822](/uploads/133779f8d4a70551a321938a7193aa3d/Copie_d_écran_20250707_234822.png) | ![Copie_d_écran_20250707_234829](/uploads/bacecd42875e3afd48dba2f9472b0f13/Copie_d_écran_20250707_234829.png) | ![Copie_d_écran_20250707_234908](/uploads/c6eff9833e33f30797088e327fcf6ea3/Copie_d_écran_20250707_234908.png) | ![Copie_d_écran_20250707_234919](/uploads/1927e2334d7e3b5790e5fab9037feff7/Copie_d_écran_20250707_234919.png) | ![Copie_d_écran_20250707_235239](/uploads/9be45b0a7b5f988de0e9ac297a2447c8/Copie_d_écran_20250707_235239.png) | Linked to https://invent.kde.org/teams/plasma-mobile/issues/-/issues/307 **Note for Reviewer**: In my local environment, i need to add manually the KAuth files otherwise polkit not recognize the implementation. ``` sudo cp ~/kde/usr/share/dbus-1/system-services/org.kde.plasma.mobileshell.waydroidhelper.service /usr/share/dbus-1/system-services/ sudo cp ~/kde/usr/share/dbus-1/system.d/org.kde.plasma.mobileshell.waydroidhelper.conf /usr/share/dbus-1/system.d/ sudo cp ~/kde/usr/share/polkit-1/actions/org.kde.plasma.mobileshell.waydroidhelper.policy /usr/share/polkit-1/actions/ ```
2025-07-10 16:00:41 +00:00
}
void WaydroidDBusObject::startSession()
kcm: Implement minimal Waydroid support I prefer create MR now to avoid biggest merge request. It add minimalist implementation: - First configuration of Waydroid - Stop / Start Waydroid session - Configure properties of Waydroid - Display current ip of Waydroid | Not installed | First initialization | initializing | SessionNotStarted | SessionStarting | SessionStarted | | ------ | ------ | ------ | ------ | ------ | ------ | | ![Copie_d_écran_20250705_162112](/uploads/66844057ee6c955803288993809616fa/Copie_d_écran_20250705_162112.png) | ![Copie_d_écran_20250707_234822](/uploads/133779f8d4a70551a321938a7193aa3d/Copie_d_écran_20250707_234822.png) | ![Copie_d_écran_20250707_234829](/uploads/bacecd42875e3afd48dba2f9472b0f13/Copie_d_écran_20250707_234829.png) | ![Copie_d_écran_20250707_234908](/uploads/c6eff9833e33f30797088e327fcf6ea3/Copie_d_écran_20250707_234908.png) | ![Copie_d_écran_20250707_234919](/uploads/1927e2334d7e3b5790e5fab9037feff7/Copie_d_écran_20250707_234919.png) | ![Copie_d_écran_20250707_235239](/uploads/9be45b0a7b5f988de0e9ac297a2447c8/Copie_d_écran_20250707_235239.png) | Linked to https://invent.kde.org/teams/plasma-mobile/issues/-/issues/307 **Note for Reviewer**: In my local environment, i need to add manually the KAuth files otherwise polkit not recognize the implementation. ``` sudo cp ~/kde/usr/share/dbus-1/system-services/org.kde.plasma.mobileshell.waydroidhelper.service /usr/share/dbus-1/system-services/ sudo cp ~/kde/usr/share/dbus-1/system.d/org.kde.plasma.mobileshell.waydroidhelper.conf /usr/share/dbus-1/system.d/ sudo cp ~/kde/usr/share/polkit-1/actions/org.kde.plasma.mobileshell.waydroidhelper.policy /usr/share/polkit-1/actions/ ```
2025-07-10 16:00:41 +00:00
{
if (m_sessionStatus == SessionStarting || m_sessionStatus == SessionRunning) {
return;
kcm: Implement minimal Waydroid support I prefer create MR now to avoid biggest merge request. It add minimalist implementation: - First configuration of Waydroid - Stop / Start Waydroid session - Configure properties of Waydroid - Display current ip of Waydroid | Not installed | First initialization | initializing | SessionNotStarted | SessionStarting | SessionStarted | | ------ | ------ | ------ | ------ | ------ | ------ | | ![Copie_d_écran_20250705_162112](/uploads/66844057ee6c955803288993809616fa/Copie_d_écran_20250705_162112.png) | ![Copie_d_écran_20250707_234822](/uploads/133779f8d4a70551a321938a7193aa3d/Copie_d_écran_20250707_234822.png) | ![Copie_d_écran_20250707_234829](/uploads/bacecd42875e3afd48dba2f9472b0f13/Copie_d_écran_20250707_234829.png) | ![Copie_d_écran_20250707_234908](/uploads/c6eff9833e33f30797088e327fcf6ea3/Copie_d_écran_20250707_234908.png) | ![Copie_d_écran_20250707_234919](/uploads/1927e2334d7e3b5790e5fab9037feff7/Copie_d_écran_20250707_234919.png) | ![Copie_d_écran_20250707_235239](/uploads/9be45b0a7b5f988de0e9ac297a2447c8/Copie_d_écran_20250707_235239.png) | Linked to https://invent.kde.org/teams/plasma-mobile/issues/-/issues/307 **Note for Reviewer**: In my local environment, i need to add manually the KAuth files otherwise polkit not recognize the implementation. ``` sudo cp ~/kde/usr/share/dbus-1/system-services/org.kde.plasma.mobileshell.waydroidhelper.service /usr/share/dbus-1/system-services/ sudo cp ~/kde/usr/share/dbus-1/system.d/org.kde.plasma.mobileshell.waydroidhelper.conf /usr/share/dbus-1/system.d/ sudo cp ~/kde/usr/share/polkit-1/actions/org.kde.plasma.mobileshell.waydroidhelper.policy /usr/share/polkit-1/actions/ ```
2025-07-10 16:00:41 +00:00
}
m_sessionStatus = SessionStarting;
Q_EMIT sessionStatusChanged();
const QStringList arguments{u"session"_s, u"start"_s};
auto *process = new QProcess(this);
process->start(WAYDROID_COMMAND, arguments);
kcm: Implement minimal Waydroid support I prefer create MR now to avoid biggest merge request. It add minimalist implementation: - First configuration of Waydroid - Stop / Start Waydroid session - Configure properties of Waydroid - Display current ip of Waydroid | Not installed | First initialization | initializing | SessionNotStarted | SessionStarting | SessionStarted | | ------ | ------ | ------ | ------ | ------ | ------ | | ![Copie_d_écran_20250705_162112](/uploads/66844057ee6c955803288993809616fa/Copie_d_écran_20250705_162112.png) | ![Copie_d_écran_20250707_234822](/uploads/133779f8d4a70551a321938a7193aa3d/Copie_d_écran_20250707_234822.png) | ![Copie_d_écran_20250707_234829](/uploads/bacecd42875e3afd48dba2f9472b0f13/Copie_d_écran_20250707_234829.png) | ![Copie_d_écran_20250707_234908](/uploads/c6eff9833e33f30797088e327fcf6ea3/Copie_d_écran_20250707_234908.png) | ![Copie_d_écran_20250707_234919](/uploads/1927e2334d7e3b5790e5fab9037feff7/Copie_d_écran_20250707_234919.png) | ![Copie_d_écran_20250707_235239](/uploads/9be45b0a7b5f988de0e9ac297a2447c8/Copie_d_écran_20250707_235239.png) | Linked to https://invent.kde.org/teams/plasma-mobile/issues/-/issues/307 **Note for Reviewer**: In my local environment, i need to add manually the KAuth files otherwise polkit not recognize the implementation. ``` sudo cp ~/kde/usr/share/dbus-1/system-services/org.kde.plasma.mobileshell.waydroidhelper.service /usr/share/dbus-1/system-services/ sudo cp ~/kde/usr/share/dbus-1/system.d/org.kde.plasma.mobileshell.waydroidhelper.conf /usr/share/dbus-1/system.d/ sudo cp ~/kde/usr/share/polkit-1/actions/org.kde.plasma.mobileshell.waydroidhelper.policy /usr/share/polkit-1/actions/ ```
2025-07-10 16:00:41 +00:00
connect(process, &QProcess::finished, this, [this, process](int exitCode, QProcess::ExitStatus exitStatus) {
kcm: Implement minimal Waydroid support I prefer create MR now to avoid biggest merge request. It add minimalist implementation: - First configuration of Waydroid - Stop / Start Waydroid session - Configure properties of Waydroid - Display current ip of Waydroid | Not installed | First initialization | initializing | SessionNotStarted | SessionStarting | SessionStarted | | ------ | ------ | ------ | ------ | ------ | ------ | | ![Copie_d_écran_20250705_162112](/uploads/66844057ee6c955803288993809616fa/Copie_d_écran_20250705_162112.png) | ![Copie_d_écran_20250707_234822](/uploads/133779f8d4a70551a321938a7193aa3d/Copie_d_écran_20250707_234822.png) | ![Copie_d_écran_20250707_234829](/uploads/bacecd42875e3afd48dba2f9472b0f13/Copie_d_écran_20250707_234829.png) | ![Copie_d_écran_20250707_234908](/uploads/c6eff9833e33f30797088e327fcf6ea3/Copie_d_écran_20250707_234908.png) | ![Copie_d_écran_20250707_234919](/uploads/1927e2334d7e3b5790e5fab9037feff7/Copie_d_écran_20250707_234919.png) | ![Copie_d_écran_20250707_235239](/uploads/9be45b0a7b5f988de0e9ac297a2447c8/Copie_d_écran_20250707_235239.png) | Linked to https://invent.kde.org/teams/plasma-mobile/issues/-/issues/307 **Note for Reviewer**: In my local environment, i need to add manually the KAuth files otherwise polkit not recognize the implementation. ``` sudo cp ~/kde/usr/share/dbus-1/system-services/org.kde.plasma.mobileshell.waydroidhelper.service /usr/share/dbus-1/system-services/ sudo cp ~/kde/usr/share/dbus-1/system.d/org.kde.plasma.mobileshell.waydroidhelper.conf /usr/share/dbus-1/system.d/ sudo cp ~/kde/usr/share/polkit-1/actions/org.kde.plasma.mobileshell.waydroidhelper.policy /usr/share/polkit-1/actions/ ```
2025-07-10 16:00:41 +00:00
Q_UNUSED(exitStatus);
if (exitCode == 0) {
return;
}
m_sessionStatus = SessionStopped;
Q_EMIT sessionStatusChanged();
QByteArray errorData = process->readAllStandardError();
kcm: Implement minimal Waydroid support I prefer create MR now to avoid biggest merge request. It add minimalist implementation: - First configuration of Waydroid - Stop / Start Waydroid session - Configure properties of Waydroid - Display current ip of Waydroid | Not installed | First initialization | initializing | SessionNotStarted | SessionStarting | SessionStarted | | ------ | ------ | ------ | ------ | ------ | ------ | | ![Copie_d_écran_20250705_162112](/uploads/66844057ee6c955803288993809616fa/Copie_d_écran_20250705_162112.png) | ![Copie_d_écran_20250707_234822](/uploads/133779f8d4a70551a321938a7193aa3d/Copie_d_écran_20250707_234822.png) | ![Copie_d_écran_20250707_234829](/uploads/bacecd42875e3afd48dba2f9472b0f13/Copie_d_écran_20250707_234829.png) | ![Copie_d_écran_20250707_234908](/uploads/c6eff9833e33f30797088e327fcf6ea3/Copie_d_écran_20250707_234908.png) | ![Copie_d_écran_20250707_234919](/uploads/1927e2334d7e3b5790e5fab9037feff7/Copie_d_écran_20250707_234919.png) | ![Copie_d_écran_20250707_235239](/uploads/9be45b0a7b5f988de0e9ac297a2447c8/Copie_d_écran_20250707_235239.png) | Linked to https://invent.kde.org/teams/plasma-mobile/issues/-/issues/307 **Note for Reviewer**: In my local environment, i need to add manually the KAuth files otherwise polkit not recognize the implementation. ``` sudo cp ~/kde/usr/share/dbus-1/system-services/org.kde.plasma.mobileshell.waydroidhelper.service /usr/share/dbus-1/system-services/ sudo cp ~/kde/usr/share/dbus-1/system.d/org.kde.plasma.mobileshell.waydroidhelper.conf /usr/share/dbus-1/system.d/ sudo cp ~/kde/usr/share/polkit-1/actions/org.kde.plasma.mobileshell.waydroidhelper.policy /usr/share/polkit-1/actions/ ```
2025-07-10 16:00:41 +00:00
QString errorString = QString::fromUtf8(errorData);
Q_EMIT errorOccurred(i18n("Failed to start the Waydroid session."), errorString);
kcm: Implement minimal Waydroid support I prefer create MR now to avoid biggest merge request. It add minimalist implementation: - First configuration of Waydroid - Stop / Start Waydroid session - Configure properties of Waydroid - Display current ip of Waydroid | Not installed | First initialization | initializing | SessionNotStarted | SessionStarting | SessionStarted | | ------ | ------ | ------ | ------ | ------ | ------ | | ![Copie_d_écran_20250705_162112](/uploads/66844057ee6c955803288993809616fa/Copie_d_écran_20250705_162112.png) | ![Copie_d_écran_20250707_234822](/uploads/133779f8d4a70551a321938a7193aa3d/Copie_d_écran_20250707_234822.png) | ![Copie_d_écran_20250707_234829](/uploads/bacecd42875e3afd48dba2f9472b0f13/Copie_d_écran_20250707_234829.png) | ![Copie_d_écran_20250707_234908](/uploads/c6eff9833e33f30797088e327fcf6ea3/Copie_d_écran_20250707_234908.png) | ![Copie_d_écran_20250707_234919](/uploads/1927e2334d7e3b5790e5fab9037feff7/Copie_d_écran_20250707_234919.png) | ![Copie_d_écran_20250707_235239](/uploads/9be45b0a7b5f988de0e9ac297a2447c8/Copie_d_écran_20250707_235239.png) | Linked to https://invent.kde.org/teams/plasma-mobile/issues/-/issues/307 **Note for Reviewer**: In my local environment, i need to add manually the KAuth files otherwise polkit not recognize the implementation. ``` sudo cp ~/kde/usr/share/dbus-1/system-services/org.kde.plasma.mobileshell.waydroidhelper.service /usr/share/dbus-1/system-services/ sudo cp ~/kde/usr/share/dbus-1/system.d/org.kde.plasma.mobileshell.waydroidhelper.conf /usr/share/dbus-1/system.d/ sudo cp ~/kde/usr/share/polkit-1/actions/org.kde.plasma.mobileshell.waydroidhelper.policy /usr/share/polkit-1/actions/ ```
2025-07-10 16:00:41 +00:00
qCWarning(WAYDROIDINTEGRATIONPLUGIN) << "Failed to start the Waydroid session: " << errorString;
});
checkSessionStarting(10);
}
void WaydroidDBusObject::stopSession()
kcm: Implement minimal Waydroid support I prefer create MR now to avoid biggest merge request. It add minimalist implementation: - First configuration of Waydroid - Stop / Start Waydroid session - Configure properties of Waydroid - Display current ip of Waydroid | Not installed | First initialization | initializing | SessionNotStarted | SessionStarting | SessionStarted | | ------ | ------ | ------ | ------ | ------ | ------ | | ![Copie_d_écran_20250705_162112](/uploads/66844057ee6c955803288993809616fa/Copie_d_écran_20250705_162112.png) | ![Copie_d_écran_20250707_234822](/uploads/133779f8d4a70551a321938a7193aa3d/Copie_d_écran_20250707_234822.png) | ![Copie_d_écran_20250707_234829](/uploads/bacecd42875e3afd48dba2f9472b0f13/Copie_d_écran_20250707_234829.png) | ![Copie_d_écran_20250707_234908](/uploads/c6eff9833e33f30797088e327fcf6ea3/Copie_d_écran_20250707_234908.png) | ![Copie_d_écran_20250707_234919](/uploads/1927e2334d7e3b5790e5fab9037feff7/Copie_d_écran_20250707_234919.png) | ![Copie_d_écran_20250707_235239](/uploads/9be45b0a7b5f988de0e9ac297a2447c8/Copie_d_écran_20250707_235239.png) | Linked to https://invent.kde.org/teams/plasma-mobile/issues/-/issues/307 **Note for Reviewer**: In my local environment, i need to add manually the KAuth files otherwise polkit not recognize the implementation. ``` sudo cp ~/kde/usr/share/dbus-1/system-services/org.kde.plasma.mobileshell.waydroidhelper.service /usr/share/dbus-1/system-services/ sudo cp ~/kde/usr/share/dbus-1/system.d/org.kde.plasma.mobileshell.waydroidhelper.conf /usr/share/dbus-1/system.d/ sudo cp ~/kde/usr/share/polkit-1/actions/org.kde.plasma.mobileshell.waydroidhelper.policy /usr/share/polkit-1/actions/ ```
2025-07-10 16:00:41 +00:00
{
if (m_sessionStatus == SessionStopped) {
return;
kcm: Implement minimal Waydroid support I prefer create MR now to avoid biggest merge request. It add minimalist implementation: - First configuration of Waydroid - Stop / Start Waydroid session - Configure properties of Waydroid - Display current ip of Waydroid | Not installed | First initialization | initializing | SessionNotStarted | SessionStarting | SessionStarted | | ------ | ------ | ------ | ------ | ------ | ------ | | ![Copie_d_écran_20250705_162112](/uploads/66844057ee6c955803288993809616fa/Copie_d_écran_20250705_162112.png) | ![Copie_d_écran_20250707_234822](/uploads/133779f8d4a70551a321938a7193aa3d/Copie_d_écran_20250707_234822.png) | ![Copie_d_écran_20250707_234829](/uploads/bacecd42875e3afd48dba2f9472b0f13/Copie_d_écran_20250707_234829.png) | ![Copie_d_écran_20250707_234908](/uploads/c6eff9833e33f30797088e327fcf6ea3/Copie_d_écran_20250707_234908.png) | ![Copie_d_écran_20250707_234919](/uploads/1927e2334d7e3b5790e5fab9037feff7/Copie_d_écran_20250707_234919.png) | ![Copie_d_écran_20250707_235239](/uploads/9be45b0a7b5f988de0e9ac297a2447c8/Copie_d_écran_20250707_235239.png) | Linked to https://invent.kde.org/teams/plasma-mobile/issues/-/issues/307 **Note for Reviewer**: In my local environment, i need to add manually the KAuth files otherwise polkit not recognize the implementation. ``` sudo cp ~/kde/usr/share/dbus-1/system-services/org.kde.plasma.mobileshell.waydroidhelper.service /usr/share/dbus-1/system-services/ sudo cp ~/kde/usr/share/dbus-1/system.d/org.kde.plasma.mobileshell.waydroidhelper.conf /usr/share/dbus-1/system.d/ sudo cp ~/kde/usr/share/polkit-1/actions/org.kde.plasma.mobileshell.waydroidhelper.policy /usr/share/polkit-1/actions/ ```
2025-07-10 16:00:41 +00:00
}
const QStringList arguments{u"session"_s, u"stop"_s};
QProcess *process = new QProcess(this);
process->start(WAYDROID_COMMAND, arguments);
process->waitForFinished();
kcm: Implement minimal Waydroid support I prefer create MR now to avoid biggest merge request. It add minimalist implementation: - First configuration of Waydroid - Stop / Start Waydroid session - Configure properties of Waydroid - Display current ip of Waydroid | Not installed | First initialization | initializing | SessionNotStarted | SessionStarting | SessionStarted | | ------ | ------ | ------ | ------ | ------ | ------ | | ![Copie_d_écran_20250705_162112](/uploads/66844057ee6c955803288993809616fa/Copie_d_écran_20250705_162112.png) | ![Copie_d_écran_20250707_234822](/uploads/133779f8d4a70551a321938a7193aa3d/Copie_d_écran_20250707_234822.png) | ![Copie_d_écran_20250707_234829](/uploads/bacecd42875e3afd48dba2f9472b0f13/Copie_d_écran_20250707_234829.png) | ![Copie_d_écran_20250707_234908](/uploads/c6eff9833e33f30797088e327fcf6ea3/Copie_d_écran_20250707_234908.png) | ![Copie_d_écran_20250707_234919](/uploads/1927e2334d7e3b5790e5fab9037feff7/Copie_d_écran_20250707_234919.png) | ![Copie_d_écran_20250707_235239](/uploads/9be45b0a7b5f988de0e9ac297a2447c8/Copie_d_écran_20250707_235239.png) | Linked to https://invent.kde.org/teams/plasma-mobile/issues/-/issues/307 **Note for Reviewer**: In my local environment, i need to add manually the KAuth files otherwise polkit not recognize the implementation. ``` sudo cp ~/kde/usr/share/dbus-1/system-services/org.kde.plasma.mobileshell.waydroidhelper.service /usr/share/dbus-1/system-services/ sudo cp ~/kde/usr/share/dbus-1/system.d/org.kde.plasma.mobileshell.waydroidhelper.conf /usr/share/dbus-1/system.d/ sudo cp ~/kde/usr/share/polkit-1/actions/org.kde.plasma.mobileshell.waydroidhelper.policy /usr/share/polkit-1/actions/ ```
2025-07-10 16:00:41 +00:00
if (process->exitCode() == 0) {
kcm: Implement minimal Waydroid support I prefer create MR now to avoid biggest merge request. It add minimalist implementation: - First configuration of Waydroid - Stop / Start Waydroid session - Configure properties of Waydroid - Display current ip of Waydroid | Not installed | First initialization | initializing | SessionNotStarted | SessionStarting | SessionStarted | | ------ | ------ | ------ | ------ | ------ | ------ | | ![Copie_d_écran_20250705_162112](/uploads/66844057ee6c955803288993809616fa/Copie_d_écran_20250705_162112.png) | ![Copie_d_écran_20250707_234822](/uploads/133779f8d4a70551a321938a7193aa3d/Copie_d_écran_20250707_234822.png) | ![Copie_d_écran_20250707_234829](/uploads/bacecd42875e3afd48dba2f9472b0f13/Copie_d_écran_20250707_234829.png) | ![Copie_d_écran_20250707_234908](/uploads/c6eff9833e33f30797088e327fcf6ea3/Copie_d_écran_20250707_234908.png) | ![Copie_d_écran_20250707_234919](/uploads/1927e2334d7e3b5790e5fab9037feff7/Copie_d_écran_20250707_234919.png) | ![Copie_d_écran_20250707_235239](/uploads/9be45b0a7b5f988de0e9ac297a2447c8/Copie_d_écran_20250707_235239.png) | Linked to https://invent.kde.org/teams/plasma-mobile/issues/-/issues/307 **Note for Reviewer**: In my local environment, i need to add manually the KAuth files otherwise polkit not recognize the implementation. ``` sudo cp ~/kde/usr/share/dbus-1/system-services/org.kde.plasma.mobileshell.waydroidhelper.service /usr/share/dbus-1/system-services/ sudo cp ~/kde/usr/share/dbus-1/system.d/org.kde.plasma.mobileshell.waydroidhelper.conf /usr/share/dbus-1/system.d/ sudo cp ~/kde/usr/share/polkit-1/actions/org.kde.plasma.mobileshell.waydroidhelper.policy /usr/share/polkit-1/actions/ ```
2025-07-10 16:00:41 +00:00
m_sessionStatus = SessionStopped;
Q_EMIT sessionStatusChanged();
} else {
qCWarning(WAYDROIDINTEGRATIONPLUGIN) << "Failed to stop the Waydroid session: " << process->readAllStandardError();
kcm: Implement minimal Waydroid support I prefer create MR now to avoid biggest merge request. It add minimalist implementation: - First configuration of Waydroid - Stop / Start Waydroid session - Configure properties of Waydroid - Display current ip of Waydroid | Not installed | First initialization | initializing | SessionNotStarted | SessionStarting | SessionStarted | | ------ | ------ | ------ | ------ | ------ | ------ | | ![Copie_d_écran_20250705_162112](/uploads/66844057ee6c955803288993809616fa/Copie_d_écran_20250705_162112.png) | ![Copie_d_écran_20250707_234822](/uploads/133779f8d4a70551a321938a7193aa3d/Copie_d_écran_20250707_234822.png) | ![Copie_d_écran_20250707_234829](/uploads/bacecd42875e3afd48dba2f9472b0f13/Copie_d_écran_20250707_234829.png) | ![Copie_d_écran_20250707_234908](/uploads/c6eff9833e33f30797088e327fcf6ea3/Copie_d_écran_20250707_234908.png) | ![Copie_d_écran_20250707_234919](/uploads/1927e2334d7e3b5790e5fab9037feff7/Copie_d_écran_20250707_234919.png) | ![Copie_d_écran_20250707_235239](/uploads/9be45b0a7b5f988de0e9ac297a2447c8/Copie_d_écran_20250707_235239.png) | Linked to https://invent.kde.org/teams/plasma-mobile/issues/-/issues/307 **Note for Reviewer**: In my local environment, i need to add manually the KAuth files otherwise polkit not recognize the implementation. ``` sudo cp ~/kde/usr/share/dbus-1/system-services/org.kde.plasma.mobileshell.waydroidhelper.service /usr/share/dbus-1/system-services/ sudo cp ~/kde/usr/share/dbus-1/system.d/org.kde.plasma.mobileshell.waydroidhelper.conf /usr/share/dbus-1/system.d/ sudo cp ~/kde/usr/share/polkit-1/actions/org.kde.plasma.mobileshell.waydroidhelper.policy /usr/share/polkit-1/actions/ ```
2025-07-10 16:00:41 +00:00
}
}
void WaydroidDBusObject::resetWaydroid()
2025-07-28 17:37:19 +00:00
{
if (m_status != Initialized || m_sessionStatus == SessionStarting) {
return;
2025-07-28 17:37:19 +00:00
}
m_status = Resetting;
Q_EMIT statusChanged();
if (m_sessionStatus == SessionRunning) {
stopSession();
2025-07-28 17:37:19 +00:00
}
const QVariantMap args = {{u"homeDir"_s, QDir::homePath()}};
KAuth::Action writeAction(u"org.kde.plasma.mobileshell.waydroidhelper.reset"_s);
writeAction.setHelperId(u"org.kde.plasma.mobileshell.waydroidhelper"_s);
writeAction.setArguments(args);
KAuth::ExecuteJob *job = writeAction.execute();
job->start();
connect(job, &KAuth::ExecuteJob::finished, this, [this](KJob *job, auto) {
removeWaydroidApplications();
2025-07-28 17:37:19 +00:00
if (job->error() == 0) {
m_status = NotInitialized;
} else {
Q_EMIT errorOccurred(i18n("Failed to reset Waydroid."), "");
2025-07-28 17:37:19 +00:00
m_status = Initialized;
qCWarning(WAYDROIDINTEGRATIONPLUGIN) << "KAuth returned an error code:" << job->error() << " message: " << job->errorString();
}
2025-07-28 17:37:19 +00:00
Q_EMIT statusChanged();
});
2025-07-28 17:37:19 +00:00
}
void WaydroidDBusObject::installApk(const QString apkFile)
kcm: Implement minimal Waydroid support I prefer create MR now to avoid biggest merge request. It add minimalist implementation: - First configuration of Waydroid - Stop / Start Waydroid session - Configure properties of Waydroid - Display current ip of Waydroid | Not installed | First initialization | initializing | SessionNotStarted | SessionStarting | SessionStarted | | ------ | ------ | ------ | ------ | ------ | ------ | | ![Copie_d_écran_20250705_162112](/uploads/66844057ee6c955803288993809616fa/Copie_d_écran_20250705_162112.png) | ![Copie_d_écran_20250707_234822](/uploads/133779f8d4a70551a321938a7193aa3d/Copie_d_écran_20250707_234822.png) | ![Copie_d_écran_20250707_234829](/uploads/bacecd42875e3afd48dba2f9472b0f13/Copie_d_écran_20250707_234829.png) | ![Copie_d_écran_20250707_234908](/uploads/c6eff9833e33f30797088e327fcf6ea3/Copie_d_écran_20250707_234908.png) | ![Copie_d_écran_20250707_234919](/uploads/1927e2334d7e3b5790e5fab9037feff7/Copie_d_écran_20250707_234919.png) | ![Copie_d_écran_20250707_235239](/uploads/9be45b0a7b5f988de0e9ac297a2447c8/Copie_d_écran_20250707_235239.png) | Linked to https://invent.kde.org/teams/plasma-mobile/issues/-/issues/307 **Note for Reviewer**: In my local environment, i need to add manually the KAuth files otherwise polkit not recognize the implementation. ``` sudo cp ~/kde/usr/share/dbus-1/system-services/org.kde.plasma.mobileshell.waydroidhelper.service /usr/share/dbus-1/system-services/ sudo cp ~/kde/usr/share/dbus-1/system.d/org.kde.plasma.mobileshell.waydroidhelper.conf /usr/share/dbus-1/system.d/ sudo cp ~/kde/usr/share/polkit-1/actions/org.kde.plasma.mobileshell.waydroidhelper.policy /usr/share/polkit-1/actions/ ```
2025-07-10 16:00:41 +00:00
{
const QStringList arguments{u"app"_s, u"install"_s, apkFile};
kcm: Implement minimal Waydroid support I prefer create MR now to avoid biggest merge request. It add minimalist implementation: - First configuration of Waydroid - Stop / Start Waydroid session - Configure properties of Waydroid - Display current ip of Waydroid | Not installed | First initialization | initializing | SessionNotStarted | SessionStarting | SessionStarted | | ------ | ------ | ------ | ------ | ------ | ------ | | ![Copie_d_écran_20250705_162112](/uploads/66844057ee6c955803288993809616fa/Copie_d_écran_20250705_162112.png) | ![Copie_d_écran_20250707_234822](/uploads/133779f8d4a70551a321938a7193aa3d/Copie_d_écran_20250707_234822.png) | ![Copie_d_écran_20250707_234829](/uploads/bacecd42875e3afd48dba2f9472b0f13/Copie_d_écran_20250707_234829.png) | ![Copie_d_écran_20250707_234908](/uploads/c6eff9833e33f30797088e327fcf6ea3/Copie_d_écran_20250707_234908.png) | ![Copie_d_écran_20250707_234919](/uploads/1927e2334d7e3b5790e5fab9037feff7/Copie_d_écran_20250707_234919.png) | ![Copie_d_écran_20250707_235239](/uploads/9be45b0a7b5f988de0e9ac297a2447c8/Copie_d_écran_20250707_235239.png) | Linked to https://invent.kde.org/teams/plasma-mobile/issues/-/issues/307 **Note for Reviewer**: In my local environment, i need to add manually the KAuth files otherwise polkit not recognize the implementation. ``` sudo cp ~/kde/usr/share/dbus-1/system-services/org.kde.plasma.mobileshell.waydroidhelper.service /usr/share/dbus-1/system-services/ sudo cp ~/kde/usr/share/dbus-1/system.d/org.kde.plasma.mobileshell.waydroidhelper.conf /usr/share/dbus-1/system.d/ sudo cp ~/kde/usr/share/polkit-1/actions/org.kde.plasma.mobileshell.waydroidhelper.policy /usr/share/polkit-1/actions/ ```
2025-07-10 16:00:41 +00:00
QProcess *process = new QProcess(this);
process->start(WAYDROID_COMMAND, arguments);
connect(process, &QProcess::finished, this, [this, apkFile, process](int exitCode, QProcess::ExitStatus exitStatus) {
if (exitCode == 0 && exitStatus == QProcess::NormalExit) {
Q_EMIT actionFinished(i18n("Application has been installed"));
} else {
Q_EMIT actionFailed(i18n("Installation Failed"));
qCWarning(WAYDROIDINTEGRATIONPLUGIN) << "Error occurred during installation of " << apkFile << ": " << process->readAllStandardError();
}
});
kcm: Implement minimal Waydroid support I prefer create MR now to avoid biggest merge request. It add minimalist implementation: - First configuration of Waydroid - Stop / Start Waydroid session - Configure properties of Waydroid - Display current ip of Waydroid | Not installed | First initialization | initializing | SessionNotStarted | SessionStarting | SessionStarted | | ------ | ------ | ------ | ------ | ------ | ------ | | ![Copie_d_écran_20250705_162112](/uploads/66844057ee6c955803288993809616fa/Copie_d_écran_20250705_162112.png) | ![Copie_d_écran_20250707_234822](/uploads/133779f8d4a70551a321938a7193aa3d/Copie_d_écran_20250707_234822.png) | ![Copie_d_écran_20250707_234829](/uploads/bacecd42875e3afd48dba2f9472b0f13/Copie_d_écran_20250707_234829.png) | ![Copie_d_écran_20250707_234908](/uploads/c6eff9833e33f30797088e327fcf6ea3/Copie_d_écran_20250707_234908.png) | ![Copie_d_écran_20250707_234919](/uploads/1927e2334d7e3b5790e5fab9037feff7/Copie_d_écran_20250707_234919.png) | ![Copie_d_écran_20250707_235239](/uploads/9be45b0a7b5f988de0e9ac297a2447c8/Copie_d_écran_20250707_235239.png) | Linked to https://invent.kde.org/teams/plasma-mobile/issues/-/issues/307 **Note for Reviewer**: In my local environment, i need to add manually the KAuth files otherwise polkit not recognize the implementation. ``` sudo cp ~/kde/usr/share/dbus-1/system-services/org.kde.plasma.mobileshell.waydroidhelper.service /usr/share/dbus-1/system-services/ sudo cp ~/kde/usr/share/dbus-1/system.d/org.kde.plasma.mobileshell.waydroidhelper.conf /usr/share/dbus-1/system.d/ sudo cp ~/kde/usr/share/polkit-1/actions/org.kde.plasma.mobileshell.waydroidhelper.policy /usr/share/polkit-1/actions/ ```
2025-07-10 16:00:41 +00:00
}
void WaydroidDBusObject::deleteApplication(const QString appId)
{
const QStringList arguments{u"app"_s, u"remove"_s, appId};
QProcess *process = new QProcess(this);
process->start(WAYDROID_COMMAND, arguments);
connect(process, &QProcess::finished, this, [this, appId, process](int exitCode, QProcess::ExitStatus exitStatus) {
Q_UNUSED(exitCode);
Q_UNUSED(exitStatus);
const QByteArray errorLog = process->readAllStandardError();
// "waydroid app remove" send log on stderr but keep exitCode to 0
if (errorLog.isEmpty()) {
Q_EMIT actionFinished(i18n("Application has been deleted"));
} else {
Q_EMIT actionFailed(i18n("Application uninstall failed"));
qCWarning(WAYDROIDINTEGRATIONPLUGIN) << "Error occurred during uninstallation of " << appId << ": " << errorLog;
}
});
}
int WaydroidDBusObject::status() const
kcm: Implement minimal Waydroid support I prefer create MR now to avoid biggest merge request. It add minimalist implementation: - First configuration of Waydroid - Stop / Start Waydroid session - Configure properties of Waydroid - Display current ip of Waydroid | Not installed | First initialization | initializing | SessionNotStarted | SessionStarting | SessionStarted | | ------ | ------ | ------ | ------ | ------ | ------ | | ![Copie_d_écran_20250705_162112](/uploads/66844057ee6c955803288993809616fa/Copie_d_écran_20250705_162112.png) | ![Copie_d_écran_20250707_234822](/uploads/133779f8d4a70551a321938a7193aa3d/Copie_d_écran_20250707_234822.png) | ![Copie_d_écran_20250707_234829](/uploads/bacecd42875e3afd48dba2f9472b0f13/Copie_d_écran_20250707_234829.png) | ![Copie_d_écran_20250707_234908](/uploads/c6eff9833e33f30797088e327fcf6ea3/Copie_d_écran_20250707_234908.png) | ![Copie_d_écran_20250707_234919](/uploads/1927e2334d7e3b5790e5fab9037feff7/Copie_d_écran_20250707_234919.png) | ![Copie_d_écran_20250707_235239](/uploads/9be45b0a7b5f988de0e9ac297a2447c8/Copie_d_écran_20250707_235239.png) | Linked to https://invent.kde.org/teams/plasma-mobile/issues/-/issues/307 **Note for Reviewer**: In my local environment, i need to add manually the KAuth files otherwise polkit not recognize the implementation. ``` sudo cp ~/kde/usr/share/dbus-1/system-services/org.kde.plasma.mobileshell.waydroidhelper.service /usr/share/dbus-1/system-services/ sudo cp ~/kde/usr/share/dbus-1/system.d/org.kde.plasma.mobileshell.waydroidhelper.conf /usr/share/dbus-1/system.d/ sudo cp ~/kde/usr/share/polkit-1/actions/org.kde.plasma.mobileshell.waydroidhelper.policy /usr/share/polkit-1/actions/ ```
2025-07-10 16:00:41 +00:00
{
return m_status;
kcm: Implement minimal Waydroid support I prefer create MR now to avoid biggest merge request. It add minimalist implementation: - First configuration of Waydroid - Stop / Start Waydroid session - Configure properties of Waydroid - Display current ip of Waydroid | Not installed | First initialization | initializing | SessionNotStarted | SessionStarting | SessionStarted | | ------ | ------ | ------ | ------ | ------ | ------ | | ![Copie_d_écran_20250705_162112](/uploads/66844057ee6c955803288993809616fa/Copie_d_écran_20250705_162112.png) | ![Copie_d_écran_20250707_234822](/uploads/133779f8d4a70551a321938a7193aa3d/Copie_d_écran_20250707_234822.png) | ![Copie_d_écran_20250707_234829](/uploads/bacecd42875e3afd48dba2f9472b0f13/Copie_d_écran_20250707_234829.png) | ![Copie_d_écran_20250707_234908](/uploads/c6eff9833e33f30797088e327fcf6ea3/Copie_d_écran_20250707_234908.png) | ![Copie_d_écran_20250707_234919](/uploads/1927e2334d7e3b5790e5fab9037feff7/Copie_d_écran_20250707_234919.png) | ![Copie_d_écran_20250707_235239](/uploads/9be45b0a7b5f988de0e9ac297a2447c8/Copie_d_écran_20250707_235239.png) | Linked to https://invent.kde.org/teams/plasma-mobile/issues/-/issues/307 **Note for Reviewer**: In my local environment, i need to add manually the KAuth files otherwise polkit not recognize the implementation. ``` sudo cp ~/kde/usr/share/dbus-1/system-services/org.kde.plasma.mobileshell.waydroidhelper.service /usr/share/dbus-1/system-services/ sudo cp ~/kde/usr/share/dbus-1/system.d/org.kde.plasma.mobileshell.waydroidhelper.conf /usr/share/dbus-1/system.d/ sudo cp ~/kde/usr/share/polkit-1/actions/org.kde.plasma.mobileshell.waydroidhelper.policy /usr/share/polkit-1/actions/ ```
2025-07-10 16:00:41 +00:00
}
int WaydroidDBusObject::sessionStatus() const
kcm: Implement minimal Waydroid support I prefer create MR now to avoid biggest merge request. It add minimalist implementation: - First configuration of Waydroid - Stop / Start Waydroid session - Configure properties of Waydroid - Display current ip of Waydroid | Not installed | First initialization | initializing | SessionNotStarted | SessionStarting | SessionStarted | | ------ | ------ | ------ | ------ | ------ | ------ | | ![Copie_d_écran_20250705_162112](/uploads/66844057ee6c955803288993809616fa/Copie_d_écran_20250705_162112.png) | ![Copie_d_écran_20250707_234822](/uploads/133779f8d4a70551a321938a7193aa3d/Copie_d_écran_20250707_234822.png) | ![Copie_d_écran_20250707_234829](/uploads/bacecd42875e3afd48dba2f9472b0f13/Copie_d_écran_20250707_234829.png) | ![Copie_d_écran_20250707_234908](/uploads/c6eff9833e33f30797088e327fcf6ea3/Copie_d_écran_20250707_234908.png) | ![Copie_d_écran_20250707_234919](/uploads/1927e2334d7e3b5790e5fab9037feff7/Copie_d_écran_20250707_234919.png) | ![Copie_d_écran_20250707_235239](/uploads/9be45b0a7b5f988de0e9ac297a2447c8/Copie_d_écran_20250707_235239.png) | Linked to https://invent.kde.org/teams/plasma-mobile/issues/-/issues/307 **Note for Reviewer**: In my local environment, i need to add manually the KAuth files otherwise polkit not recognize the implementation. ``` sudo cp ~/kde/usr/share/dbus-1/system-services/org.kde.plasma.mobileshell.waydroidhelper.service /usr/share/dbus-1/system-services/ sudo cp ~/kde/usr/share/dbus-1/system.d/org.kde.plasma.mobileshell.waydroidhelper.conf /usr/share/dbus-1/system.d/ sudo cp ~/kde/usr/share/polkit-1/actions/org.kde.plasma.mobileshell.waydroidhelper.policy /usr/share/polkit-1/actions/ ```
2025-07-10 16:00:41 +00:00
{
return m_sessionStatus;
kcm: Implement minimal Waydroid support I prefer create MR now to avoid biggest merge request. It add minimalist implementation: - First configuration of Waydroid - Stop / Start Waydroid session - Configure properties of Waydroid - Display current ip of Waydroid | Not installed | First initialization | initializing | SessionNotStarted | SessionStarting | SessionStarted | | ------ | ------ | ------ | ------ | ------ | ------ | | ![Copie_d_écran_20250705_162112](/uploads/66844057ee6c955803288993809616fa/Copie_d_écran_20250705_162112.png) | ![Copie_d_écran_20250707_234822](/uploads/133779f8d4a70551a321938a7193aa3d/Copie_d_écran_20250707_234822.png) | ![Copie_d_écran_20250707_234829](/uploads/bacecd42875e3afd48dba2f9472b0f13/Copie_d_écran_20250707_234829.png) | ![Copie_d_écran_20250707_234908](/uploads/c6eff9833e33f30797088e327fcf6ea3/Copie_d_écran_20250707_234908.png) | ![Copie_d_écran_20250707_234919](/uploads/1927e2334d7e3b5790e5fab9037feff7/Copie_d_écran_20250707_234919.png) | ![Copie_d_écran_20250707_235239](/uploads/9be45b0a7b5f988de0e9ac297a2447c8/Copie_d_écran_20250707_235239.png) | Linked to https://invent.kde.org/teams/plasma-mobile/issues/-/issues/307 **Note for Reviewer**: In my local environment, i need to add manually the KAuth files otherwise polkit not recognize the implementation. ``` sudo cp ~/kde/usr/share/dbus-1/system-services/org.kde.plasma.mobileshell.waydroidhelper.service /usr/share/dbus-1/system-services/ sudo cp ~/kde/usr/share/dbus-1/system.d/org.kde.plasma.mobileshell.waydroidhelper.conf /usr/share/dbus-1/system.d/ sudo cp ~/kde/usr/share/polkit-1/actions/org.kde.plasma.mobileshell.waydroidhelper.policy /usr/share/polkit-1/actions/ ```
2025-07-10 16:00:41 +00:00
}
int WaydroidDBusObject::systemType() const
kcm: Implement minimal Waydroid support I prefer create MR now to avoid biggest merge request. It add minimalist implementation: - First configuration of Waydroid - Stop / Start Waydroid session - Configure properties of Waydroid - Display current ip of Waydroid | Not installed | First initialization | initializing | SessionNotStarted | SessionStarting | SessionStarted | | ------ | ------ | ------ | ------ | ------ | ------ | | ![Copie_d_écran_20250705_162112](/uploads/66844057ee6c955803288993809616fa/Copie_d_écran_20250705_162112.png) | ![Copie_d_écran_20250707_234822](/uploads/133779f8d4a70551a321938a7193aa3d/Copie_d_écran_20250707_234822.png) | ![Copie_d_écran_20250707_234829](/uploads/bacecd42875e3afd48dba2f9472b0f13/Copie_d_écran_20250707_234829.png) | ![Copie_d_écran_20250707_234908](/uploads/c6eff9833e33f30797088e327fcf6ea3/Copie_d_écran_20250707_234908.png) | ![Copie_d_écran_20250707_234919](/uploads/1927e2334d7e3b5790e5fab9037feff7/Copie_d_écran_20250707_234919.png) | ![Copie_d_écran_20250707_235239](/uploads/9be45b0a7b5f988de0e9ac297a2447c8/Copie_d_écran_20250707_235239.png) | Linked to https://invent.kde.org/teams/plasma-mobile/issues/-/issues/307 **Note for Reviewer**: In my local environment, i need to add manually the KAuth files otherwise polkit not recognize the implementation. ``` sudo cp ~/kde/usr/share/dbus-1/system-services/org.kde.plasma.mobileshell.waydroidhelper.service /usr/share/dbus-1/system-services/ sudo cp ~/kde/usr/share/dbus-1/system.d/org.kde.plasma.mobileshell.waydroidhelper.conf /usr/share/dbus-1/system.d/ sudo cp ~/kde/usr/share/polkit-1/actions/org.kde.plasma.mobileshell.waydroidhelper.policy /usr/share/polkit-1/actions/ ```
2025-07-10 16:00:41 +00:00
{
return m_systemType;
kcm: Implement minimal Waydroid support I prefer create MR now to avoid biggest merge request. It add minimalist implementation: - First configuration of Waydroid - Stop / Start Waydroid session - Configure properties of Waydroid - Display current ip of Waydroid | Not installed | First initialization | initializing | SessionNotStarted | SessionStarting | SessionStarted | | ------ | ------ | ------ | ------ | ------ | ------ | | ![Copie_d_écran_20250705_162112](/uploads/66844057ee6c955803288993809616fa/Copie_d_écran_20250705_162112.png) | ![Copie_d_écran_20250707_234822](/uploads/133779f8d4a70551a321938a7193aa3d/Copie_d_écran_20250707_234822.png) | ![Copie_d_écran_20250707_234829](/uploads/bacecd42875e3afd48dba2f9472b0f13/Copie_d_écran_20250707_234829.png) | ![Copie_d_écran_20250707_234908](/uploads/c6eff9833e33f30797088e327fcf6ea3/Copie_d_écran_20250707_234908.png) | ![Copie_d_écran_20250707_234919](/uploads/1927e2334d7e3b5790e5fab9037feff7/Copie_d_écran_20250707_234919.png) | ![Copie_d_écran_20250707_235239](/uploads/9be45b0a7b5f988de0e9ac297a2447c8/Copie_d_écran_20250707_235239.png) | Linked to https://invent.kde.org/teams/plasma-mobile/issues/-/issues/307 **Note for Reviewer**: In my local environment, i need to add manually the KAuth files otherwise polkit not recognize the implementation. ``` sudo cp ~/kde/usr/share/dbus-1/system-services/org.kde.plasma.mobileshell.waydroidhelper.service /usr/share/dbus-1/system-services/ sudo cp ~/kde/usr/share/dbus-1/system.d/org.kde.plasma.mobileshell.waydroidhelper.conf /usr/share/dbus-1/system.d/ sudo cp ~/kde/usr/share/polkit-1/actions/org.kde.plasma.mobileshell.waydroidhelper.policy /usr/share/polkit-1/actions/ ```
2025-07-10 16:00:41 +00:00
}
QString WaydroidDBusObject::ipAddress() const
2025-07-10 16:57:34 +00:00
{
return m_ipAddress;
2025-07-10 16:57:34 +00:00
}
QString WaydroidDBusObject::androidId() const
2025-07-14 10:47:21 +00:00
{
return m_androidId;
2025-07-14 10:47:21 +00:00
}
bool WaydroidDBusObject::multiWindows() const
kcm: Implement minimal Waydroid support I prefer create MR now to avoid biggest merge request. It add minimalist implementation: - First configuration of Waydroid - Stop / Start Waydroid session - Configure properties of Waydroid - Display current ip of Waydroid | Not installed | First initialization | initializing | SessionNotStarted | SessionStarting | SessionStarted | | ------ | ------ | ------ | ------ | ------ | ------ | | ![Copie_d_écran_20250705_162112](/uploads/66844057ee6c955803288993809616fa/Copie_d_écran_20250705_162112.png) | ![Copie_d_écran_20250707_234822](/uploads/133779f8d4a70551a321938a7193aa3d/Copie_d_écran_20250707_234822.png) | ![Copie_d_écran_20250707_234829](/uploads/bacecd42875e3afd48dba2f9472b0f13/Copie_d_écran_20250707_234829.png) | ![Copie_d_écran_20250707_234908](/uploads/c6eff9833e33f30797088e327fcf6ea3/Copie_d_écran_20250707_234908.png) | ![Copie_d_écran_20250707_234919](/uploads/1927e2334d7e3b5790e5fab9037feff7/Copie_d_écran_20250707_234919.png) | ![Copie_d_écran_20250707_235239](/uploads/9be45b0a7b5f988de0e9ac297a2447c8/Copie_d_écran_20250707_235239.png) | Linked to https://invent.kde.org/teams/plasma-mobile/issues/-/issues/307 **Note for Reviewer**: In my local environment, i need to add manually the KAuth files otherwise polkit not recognize the implementation. ``` sudo cp ~/kde/usr/share/dbus-1/system-services/org.kde.plasma.mobileshell.waydroidhelper.service /usr/share/dbus-1/system-services/ sudo cp ~/kde/usr/share/dbus-1/system.d/org.kde.plasma.mobileshell.waydroidhelper.conf /usr/share/dbus-1/system.d/ sudo cp ~/kde/usr/share/polkit-1/actions/org.kde.plasma.mobileshell.waydroidhelper.policy /usr/share/polkit-1/actions/ ```
2025-07-10 16:00:41 +00:00
{
return m_multiWindows;
}
void WaydroidDBusObject::setMultiWindows(const bool multiWindows)
kcm: Implement minimal Waydroid support I prefer create MR now to avoid biggest merge request. It add minimalist implementation: - First configuration of Waydroid - Stop / Start Waydroid session - Configure properties of Waydroid - Display current ip of Waydroid | Not installed | First initialization | initializing | SessionNotStarted | SessionStarting | SessionStarted | | ------ | ------ | ------ | ------ | ------ | ------ | | ![Copie_d_écran_20250705_162112](/uploads/66844057ee6c955803288993809616fa/Copie_d_écran_20250705_162112.png) | ![Copie_d_écran_20250707_234822](/uploads/133779f8d4a70551a321938a7193aa3d/Copie_d_écran_20250707_234822.png) | ![Copie_d_écran_20250707_234829](/uploads/bacecd42875e3afd48dba2f9472b0f13/Copie_d_écran_20250707_234829.png) | ![Copie_d_écran_20250707_234908](/uploads/c6eff9833e33f30797088e327fcf6ea3/Copie_d_écran_20250707_234908.png) | ![Copie_d_écran_20250707_234919](/uploads/1927e2334d7e3b5790e5fab9037feff7/Copie_d_écran_20250707_234919.png) | ![Copie_d_écran_20250707_235239](/uploads/9be45b0a7b5f988de0e9ac297a2447c8/Copie_d_écran_20250707_235239.png) | Linked to https://invent.kde.org/teams/plasma-mobile/issues/-/issues/307 **Note for Reviewer**: In my local environment, i need to add manually the KAuth files otherwise polkit not recognize the implementation. ``` sudo cp ~/kde/usr/share/dbus-1/system-services/org.kde.plasma.mobileshell.waydroidhelper.service /usr/share/dbus-1/system-services/ sudo cp ~/kde/usr/share/dbus-1/system.d/org.kde.plasma.mobileshell.waydroidhelper.conf /usr/share/dbus-1/system.d/ sudo cp ~/kde/usr/share/polkit-1/actions/org.kde.plasma.mobileshell.waydroidhelper.policy /usr/share/polkit-1/actions/ ```
2025-07-10 16:00:41 +00:00
{
if (m_multiWindows == multiWindows) {
return;
}
const QString value = multiWindows ? "true" : "false";
if (writePropValue(MULTI_WINDOWS_PROP_KEY, value)) {
m_multiWindows = multiWindows;
Q_EMIT multiWindowsChanged();
}
}
bool WaydroidDBusObject::suspend() const
kcm: Implement minimal Waydroid support I prefer create MR now to avoid biggest merge request. It add minimalist implementation: - First configuration of Waydroid - Stop / Start Waydroid session - Configure properties of Waydroid - Display current ip of Waydroid | Not installed | First initialization | initializing | SessionNotStarted | SessionStarting | SessionStarted | | ------ | ------ | ------ | ------ | ------ | ------ | | ![Copie_d_écran_20250705_162112](/uploads/66844057ee6c955803288993809616fa/Copie_d_écran_20250705_162112.png) | ![Copie_d_écran_20250707_234822](/uploads/133779f8d4a70551a321938a7193aa3d/Copie_d_écran_20250707_234822.png) | ![Copie_d_écran_20250707_234829](/uploads/bacecd42875e3afd48dba2f9472b0f13/Copie_d_écran_20250707_234829.png) | ![Copie_d_écran_20250707_234908](/uploads/c6eff9833e33f30797088e327fcf6ea3/Copie_d_écran_20250707_234908.png) | ![Copie_d_écran_20250707_234919](/uploads/1927e2334d7e3b5790e5fab9037feff7/Copie_d_écran_20250707_234919.png) | ![Copie_d_écran_20250707_235239](/uploads/9be45b0a7b5f988de0e9ac297a2447c8/Copie_d_écran_20250707_235239.png) | Linked to https://invent.kde.org/teams/plasma-mobile/issues/-/issues/307 **Note for Reviewer**: In my local environment, i need to add manually the KAuth files otherwise polkit not recognize the implementation. ``` sudo cp ~/kde/usr/share/dbus-1/system-services/org.kde.plasma.mobileshell.waydroidhelper.service /usr/share/dbus-1/system-services/ sudo cp ~/kde/usr/share/dbus-1/system.d/org.kde.plasma.mobileshell.waydroidhelper.conf /usr/share/dbus-1/system.d/ sudo cp ~/kde/usr/share/polkit-1/actions/org.kde.plasma.mobileshell.waydroidhelper.policy /usr/share/polkit-1/actions/ ```
2025-07-10 16:00:41 +00:00
{
return m_suspend;
}
void WaydroidDBusObject::setSuspend(const bool suspend)
kcm: Implement minimal Waydroid support I prefer create MR now to avoid biggest merge request. It add minimalist implementation: - First configuration of Waydroid - Stop / Start Waydroid session - Configure properties of Waydroid - Display current ip of Waydroid | Not installed | First initialization | initializing | SessionNotStarted | SessionStarting | SessionStarted | | ------ | ------ | ------ | ------ | ------ | ------ | | ![Copie_d_écran_20250705_162112](/uploads/66844057ee6c955803288993809616fa/Copie_d_écran_20250705_162112.png) | ![Copie_d_écran_20250707_234822](/uploads/133779f8d4a70551a321938a7193aa3d/Copie_d_écran_20250707_234822.png) | ![Copie_d_écran_20250707_234829](/uploads/bacecd42875e3afd48dba2f9472b0f13/Copie_d_écran_20250707_234829.png) | ![Copie_d_écran_20250707_234908](/uploads/c6eff9833e33f30797088e327fcf6ea3/Copie_d_écran_20250707_234908.png) | ![Copie_d_écran_20250707_234919](/uploads/1927e2334d7e3b5790e5fab9037feff7/Copie_d_écran_20250707_234919.png) | ![Copie_d_écran_20250707_235239](/uploads/9be45b0a7b5f988de0e9ac297a2447c8/Copie_d_écran_20250707_235239.png) | Linked to https://invent.kde.org/teams/plasma-mobile/issues/-/issues/307 **Note for Reviewer**: In my local environment, i need to add manually the KAuth files otherwise polkit not recognize the implementation. ``` sudo cp ~/kde/usr/share/dbus-1/system-services/org.kde.plasma.mobileshell.waydroidhelper.service /usr/share/dbus-1/system-services/ sudo cp ~/kde/usr/share/dbus-1/system.d/org.kde.plasma.mobileshell.waydroidhelper.conf /usr/share/dbus-1/system.d/ sudo cp ~/kde/usr/share/polkit-1/actions/org.kde.plasma.mobileshell.waydroidhelper.policy /usr/share/polkit-1/actions/ ```
2025-07-10 16:00:41 +00:00
{
if (m_suspend == suspend) {
return;
}
const QString value = suspend ? "true" : "false";
if (writePropValue(SUSPEND_PROP_KEY, value)) {
m_suspend = suspend;
Q_EMIT suspendChanged();
}
}
bool WaydroidDBusObject::uevent() const
kcm: Implement minimal Waydroid support I prefer create MR now to avoid biggest merge request. It add minimalist implementation: - First configuration of Waydroid - Stop / Start Waydroid session - Configure properties of Waydroid - Display current ip of Waydroid | Not installed | First initialization | initializing | SessionNotStarted | SessionStarting | SessionStarted | | ------ | ------ | ------ | ------ | ------ | ------ | | ![Copie_d_écran_20250705_162112](/uploads/66844057ee6c955803288993809616fa/Copie_d_écran_20250705_162112.png) | ![Copie_d_écran_20250707_234822](/uploads/133779f8d4a70551a321938a7193aa3d/Copie_d_écran_20250707_234822.png) | ![Copie_d_écran_20250707_234829](/uploads/bacecd42875e3afd48dba2f9472b0f13/Copie_d_écran_20250707_234829.png) | ![Copie_d_écran_20250707_234908](/uploads/c6eff9833e33f30797088e327fcf6ea3/Copie_d_écran_20250707_234908.png) | ![Copie_d_écran_20250707_234919](/uploads/1927e2334d7e3b5790e5fab9037feff7/Copie_d_écran_20250707_234919.png) | ![Copie_d_écran_20250707_235239](/uploads/9be45b0a7b5f988de0e9ac297a2447c8/Copie_d_écran_20250707_235239.png) | Linked to https://invent.kde.org/teams/plasma-mobile/issues/-/issues/307 **Note for Reviewer**: In my local environment, i need to add manually the KAuth files otherwise polkit not recognize the implementation. ``` sudo cp ~/kde/usr/share/dbus-1/system-services/org.kde.plasma.mobileshell.waydroidhelper.service /usr/share/dbus-1/system-services/ sudo cp ~/kde/usr/share/dbus-1/system.d/org.kde.plasma.mobileshell.waydroidhelper.conf /usr/share/dbus-1/system.d/ sudo cp ~/kde/usr/share/polkit-1/actions/org.kde.plasma.mobileshell.waydroidhelper.policy /usr/share/polkit-1/actions/ ```
2025-07-10 16:00:41 +00:00
{
return m_uevent;
}
void WaydroidDBusObject::setUevent(const bool uevent)
kcm: Implement minimal Waydroid support I prefer create MR now to avoid biggest merge request. It add minimalist implementation: - First configuration of Waydroid - Stop / Start Waydroid session - Configure properties of Waydroid - Display current ip of Waydroid | Not installed | First initialization | initializing | SessionNotStarted | SessionStarting | SessionStarted | | ------ | ------ | ------ | ------ | ------ | ------ | | ![Copie_d_écran_20250705_162112](/uploads/66844057ee6c955803288993809616fa/Copie_d_écran_20250705_162112.png) | ![Copie_d_écran_20250707_234822](/uploads/133779f8d4a70551a321938a7193aa3d/Copie_d_écran_20250707_234822.png) | ![Copie_d_écran_20250707_234829](/uploads/bacecd42875e3afd48dba2f9472b0f13/Copie_d_écran_20250707_234829.png) | ![Copie_d_écran_20250707_234908](/uploads/c6eff9833e33f30797088e327fcf6ea3/Copie_d_écran_20250707_234908.png) | ![Copie_d_écran_20250707_234919](/uploads/1927e2334d7e3b5790e5fab9037feff7/Copie_d_écran_20250707_234919.png) | ![Copie_d_écran_20250707_235239](/uploads/9be45b0a7b5f988de0e9ac297a2447c8/Copie_d_écran_20250707_235239.png) | Linked to https://invent.kde.org/teams/plasma-mobile/issues/-/issues/307 **Note for Reviewer**: In my local environment, i need to add manually the KAuth files otherwise polkit not recognize the implementation. ``` sudo cp ~/kde/usr/share/dbus-1/system-services/org.kde.plasma.mobileshell.waydroidhelper.service /usr/share/dbus-1/system-services/ sudo cp ~/kde/usr/share/dbus-1/system.d/org.kde.plasma.mobileshell.waydroidhelper.conf /usr/share/dbus-1/system.d/ sudo cp ~/kde/usr/share/polkit-1/actions/org.kde.plasma.mobileshell.waydroidhelper.policy /usr/share/polkit-1/actions/ ```
2025-07-10 16:00:41 +00:00
{
if (m_uevent == uevent) {
return;
}
const QString value = uevent ? "true" : "false";
if (writePropValue(UEVENT_PROP_KEY, value)) {
m_uevent = uevent;
Q_EMIT ueventChanged();
}
}
QList<QDBusObjectPath> WaydroidDBusObject::applications() const
{
QList<QDBusObjectPath> paths;
for (const auto &app : m_applicationObjects) {
paths.push_back(app->objectPath());
}
return paths;
}
void WaydroidDBusObject::refreshSupportsInfo()
{
const QStringList arguments{u"-h"_s};
auto process = QProcess(this);
process.start(WAYDROID_COMMAND, arguments);
process.waitForFinished();
const int exitCode = process.exitCode();
if (exitCode != 0) {
m_status = NotSupported;
Q_EMIT statusChanged();
return;
}
const QString output = fetchSessionInfo();
if (!output.contains("WayDroid is not initialized")) {
m_status = Initialized;
} else {
m_status = NotInitialized;
}
Q_EMIT statusChanged();
}
void WaydroidDBusObject::refreshInstallationInfo()
{
if (m_status != Initialized) {
return;
}
QFile file("/var/lib/waydroid/waydroid.cfg");
if (!file.open(QIODevice::ReadOnly | QIODevice::Text)) {
return;
}
QTextStream in(&file);
const QString fileContent = in.readAll();
const QString systemMatch = extractRegExp(fileContent, systemOtaRegExp);
if (systemMatch.contains("vanilla", Qt::CaseInsensitive)) {
m_systemType = Vanilla;
} else if (systemMatch.contains("gapps", Qt::CaseInsensitive)) {
m_systemType = Gapps;
} else if (systemMatch.contains("foss", Qt::CaseInsensitive)) {
m_systemType = Foss;
} else {
m_systemType = UnknownSystemType;
}
Q_EMIT systemTypeChanged();
}
void WaydroidDBusObject::refreshSessionInfo()
{
if (m_status != Initialized) {
return;
}
const QString output = fetchSessionInfo();
const QString sessionMatchResult = extractRegExp(output, sessionRegExp);
SessionStatus newSessionStatus;
if (!sessionMatchResult.isEmpty()) {
newSessionStatus = sessionMatchResult.contains("RUNNING") ? SessionRunning : SessionStopped;
} else {
newSessionStatus = SessionStopped;
}
if (m_sessionStatus != newSessionStatus) {
m_sessionStatus = newSessionStatus;
Q_EMIT sessionStatusChanged();
}
m_ipAddress = extractRegExp(output, ipAdressRegExp);
Q_EMIT ipAddressChanged();
}
QString WaydroidDBusObject::fetchSessionInfo()
kcm: Implement minimal Waydroid support I prefer create MR now to avoid biggest merge request. It add minimalist implementation: - First configuration of Waydroid - Stop / Start Waydroid session - Configure properties of Waydroid - Display current ip of Waydroid | Not installed | First initialization | initializing | SessionNotStarted | SessionStarting | SessionStarted | | ------ | ------ | ------ | ------ | ------ | ------ | | ![Copie_d_écran_20250705_162112](/uploads/66844057ee6c955803288993809616fa/Copie_d_écran_20250705_162112.png) | ![Copie_d_écran_20250707_234822](/uploads/133779f8d4a70551a321938a7193aa3d/Copie_d_écran_20250707_234822.png) | ![Copie_d_écran_20250707_234829](/uploads/bacecd42875e3afd48dba2f9472b0f13/Copie_d_écran_20250707_234829.png) | ![Copie_d_écran_20250707_234908](/uploads/c6eff9833e33f30797088e327fcf6ea3/Copie_d_écran_20250707_234908.png) | ![Copie_d_écran_20250707_234919](/uploads/1927e2334d7e3b5790e5fab9037feff7/Copie_d_écran_20250707_234919.png) | ![Copie_d_écran_20250707_235239](/uploads/9be45b0a7b5f988de0e9ac297a2447c8/Copie_d_écran_20250707_235239.png) | Linked to https://invent.kde.org/teams/plasma-mobile/issues/-/issues/307 **Note for Reviewer**: In my local environment, i need to add manually the KAuth files otherwise polkit not recognize the implementation. ``` sudo cp ~/kde/usr/share/dbus-1/system-services/org.kde.plasma.mobileshell.waydroidhelper.service /usr/share/dbus-1/system-services/ sudo cp ~/kde/usr/share/dbus-1/system.d/org.kde.plasma.mobileshell.waydroidhelper.conf /usr/share/dbus-1/system.d/ sudo cp ~/kde/usr/share/polkit-1/actions/org.kde.plasma.mobileshell.waydroidhelper.policy /usr/share/polkit-1/actions/ ```
2025-07-10 16:00:41 +00:00
{
const QStringList arguments{u"status"_s};
auto process = QProcess(this);
process.start(WAYDROID_COMMAND, arguments);
process.waitForFinished();
kcm: Implement minimal Waydroid support I prefer create MR now to avoid biggest merge request. It add minimalist implementation: - First configuration of Waydroid - Stop / Start Waydroid session - Configure properties of Waydroid - Display current ip of Waydroid | Not installed | First initialization | initializing | SessionNotStarted | SessionStarting | SessionStarted | | ------ | ------ | ------ | ------ | ------ | ------ | | ![Copie_d_écran_20250705_162112](/uploads/66844057ee6c955803288993809616fa/Copie_d_écran_20250705_162112.png) | ![Copie_d_écran_20250707_234822](/uploads/133779f8d4a70551a321938a7193aa3d/Copie_d_écran_20250707_234822.png) | ![Copie_d_écran_20250707_234829](/uploads/bacecd42875e3afd48dba2f9472b0f13/Copie_d_écran_20250707_234829.png) | ![Copie_d_écran_20250707_234908](/uploads/c6eff9833e33f30797088e327fcf6ea3/Copie_d_écran_20250707_234908.png) | ![Copie_d_écran_20250707_234919](/uploads/1927e2334d7e3b5790e5fab9037feff7/Copie_d_écran_20250707_234919.png) | ![Copie_d_écran_20250707_235239](/uploads/9be45b0a7b5f988de0e9ac297a2447c8/Copie_d_écran_20250707_235239.png) | Linked to https://invent.kde.org/teams/plasma-mobile/issues/-/issues/307 **Note for Reviewer**: In my local environment, i need to add manually the KAuth files otherwise polkit not recognize the implementation. ``` sudo cp ~/kde/usr/share/dbus-1/system-services/org.kde.plasma.mobileshell.waydroidhelper.service /usr/share/dbus-1/system-services/ sudo cp ~/kde/usr/share/dbus-1/system.d/org.kde.plasma.mobileshell.waydroidhelper.conf /usr/share/dbus-1/system.d/ sudo cp ~/kde/usr/share/polkit-1/actions/org.kde.plasma.mobileshell.waydroidhelper.policy /usr/share/polkit-1/actions/ ```
2025-07-10 16:00:41 +00:00
return process.readAllStandardOutput();
kcm: Implement minimal Waydroid support I prefer create MR now to avoid biggest merge request. It add minimalist implementation: - First configuration of Waydroid - Stop / Start Waydroid session - Configure properties of Waydroid - Display current ip of Waydroid | Not installed | First initialization | initializing | SessionNotStarted | SessionStarting | SessionStarted | | ------ | ------ | ------ | ------ | ------ | ------ | | ![Copie_d_écran_20250705_162112](/uploads/66844057ee6c955803288993809616fa/Copie_d_écran_20250705_162112.png) | ![Copie_d_écran_20250707_234822](/uploads/133779f8d4a70551a321938a7193aa3d/Copie_d_écran_20250707_234822.png) | ![Copie_d_écran_20250707_234829](/uploads/bacecd42875e3afd48dba2f9472b0f13/Copie_d_écran_20250707_234829.png) | ![Copie_d_écran_20250707_234908](/uploads/c6eff9833e33f30797088e327fcf6ea3/Copie_d_écran_20250707_234908.png) | ![Copie_d_écran_20250707_234919](/uploads/1927e2334d7e3b5790e5fab9037feff7/Copie_d_écran_20250707_234919.png) | ![Copie_d_écran_20250707_235239](/uploads/9be45b0a7b5f988de0e9ac297a2447c8/Copie_d_écran_20250707_235239.png) | Linked to https://invent.kde.org/teams/plasma-mobile/issues/-/issues/307 **Note for Reviewer**: In my local environment, i need to add manually the KAuth files otherwise polkit not recognize the implementation. ``` sudo cp ~/kde/usr/share/dbus-1/system-services/org.kde.plasma.mobileshell.waydroidhelper.service /usr/share/dbus-1/system-services/ sudo cp ~/kde/usr/share/dbus-1/system.d/org.kde.plasma.mobileshell.waydroidhelper.conf /usr/share/dbus-1/system.d/ sudo cp ~/kde/usr/share/polkit-1/actions/org.kde.plasma.mobileshell.waydroidhelper.policy /usr/share/polkit-1/actions/ ```
2025-07-10 16:00:41 +00:00
}
void WaydroidDBusObject::refreshAndroidId()
{
if (m_status != Initialized) {
return;
}
KAuth::Action writeAction(u"org.kde.plasma.mobileshell.waydroidhelper.getandroidid"_s);
writeAction.setHelperId(u"org.kde.plasma.mobileshell.waydroidhelper"_s);
KAuth::ExecuteJob *job = writeAction.execute();
job->start();
connect(job, &KAuth::ExecuteJob::finished, this, [this](KJob *job, auto) {
KAuth::ExecuteJob *executeJob = dynamic_cast<KAuth::ExecuteJob *>(job);
if (executeJob->error() == 0) {
m_androidId = executeJob->data()["android_id"].toString();
if (m_androidId.isEmpty()) {
Q_EMIT actionFailed(i18n("Android ID not found"));
}
} else {
m_androidId = "";
qCWarning(WAYDROIDINTEGRATIONPLUGIN) << "KAuth returned an error code:" << executeJob->error();
}
Q_EMIT androidIdChanged();
});
}
void WaydroidDBusObject::refreshPropsInfo()
{
if (m_sessionStatus != SessionRunning) {
return;
}
const QString multiWindowsPropValue = fetchPropValue(MULTI_WINDOWS_PROP_KEY, "false");
m_multiWindows = multiWindowsPropValue == "true";
Q_EMIT multiWindowsChanged();
const QString suspendPropValue = fetchPropValue(SUSPEND_PROP_KEY, "true");
m_suspend = suspendPropValue == "true";
Q_EMIT suspendChanged();
const QString ueventPropValue = fetchPropValue(UEVENT_PROP_KEY, "false");
m_uevent = ueventPropValue == "true";
Q_EMIT ueventChanged();
}
QString WaydroidDBusObject::fetchPropValue(const QString key, const QString defaultValue)
kcm: Implement minimal Waydroid support I prefer create MR now to avoid biggest merge request. It add minimalist implementation: - First configuration of Waydroid - Stop / Start Waydroid session - Configure properties of Waydroid - Display current ip of Waydroid | Not installed | First initialization | initializing | SessionNotStarted | SessionStarting | SessionStarted | | ------ | ------ | ------ | ------ | ------ | ------ | | ![Copie_d_écran_20250705_162112](/uploads/66844057ee6c955803288993809616fa/Copie_d_écran_20250705_162112.png) | ![Copie_d_écran_20250707_234822](/uploads/133779f8d4a70551a321938a7193aa3d/Copie_d_écran_20250707_234822.png) | ![Copie_d_écran_20250707_234829](/uploads/bacecd42875e3afd48dba2f9472b0f13/Copie_d_écran_20250707_234829.png) | ![Copie_d_écran_20250707_234908](/uploads/c6eff9833e33f30797088e327fcf6ea3/Copie_d_écran_20250707_234908.png) | ![Copie_d_écran_20250707_234919](/uploads/1927e2334d7e3b5790e5fab9037feff7/Copie_d_écran_20250707_234919.png) | ![Copie_d_écran_20250707_235239](/uploads/9be45b0a7b5f988de0e9ac297a2447c8/Copie_d_écran_20250707_235239.png) | Linked to https://invent.kde.org/teams/plasma-mobile/issues/-/issues/307 **Note for Reviewer**: In my local environment, i need to add manually the KAuth files otherwise polkit not recognize the implementation. ``` sudo cp ~/kde/usr/share/dbus-1/system-services/org.kde.plasma.mobileshell.waydroidhelper.service /usr/share/dbus-1/system-services/ sudo cp ~/kde/usr/share/dbus-1/system.d/org.kde.plasma.mobileshell.waydroidhelper.conf /usr/share/dbus-1/system.d/ sudo cp ~/kde/usr/share/polkit-1/actions/org.kde.plasma.mobileshell.waydroidhelper.policy /usr/share/polkit-1/actions/ ```
2025-07-10 16:00:41 +00:00
{
const QStringList arguments{u"prop"_s, u"get"_s, key};
QProcess *process = new QProcess(this);
process->start(WAYDROID_COMMAND, arguments);
process->waitForFinished();
const QString commandOutput = process->readAllStandardOutput();
const QString value = commandOutput.split("\n").first().trimmed();
if (value.isEmpty()) {
return defaultValue;
}
return value;
}
bool WaydroidDBusObject::writePropValue(const QString key, const QString value)
kcm: Implement minimal Waydroid support I prefer create MR now to avoid biggest merge request. It add minimalist implementation: - First configuration of Waydroid - Stop / Start Waydroid session - Configure properties of Waydroid - Display current ip of Waydroid | Not installed | First initialization | initializing | SessionNotStarted | SessionStarting | SessionStarted | | ------ | ------ | ------ | ------ | ------ | ------ | | ![Copie_d_écran_20250705_162112](/uploads/66844057ee6c955803288993809616fa/Copie_d_écran_20250705_162112.png) | ![Copie_d_écran_20250707_234822](/uploads/133779f8d4a70551a321938a7193aa3d/Copie_d_écran_20250707_234822.png) | ![Copie_d_écran_20250707_234829](/uploads/bacecd42875e3afd48dba2f9472b0f13/Copie_d_écran_20250707_234829.png) | ![Copie_d_écran_20250707_234908](/uploads/c6eff9833e33f30797088e327fcf6ea3/Copie_d_écran_20250707_234908.png) | ![Copie_d_écran_20250707_234919](/uploads/1927e2334d7e3b5790e5fab9037feff7/Copie_d_écran_20250707_234919.png) | ![Copie_d_écran_20250707_235239](/uploads/9be45b0a7b5f988de0e9ac297a2447c8/Copie_d_écran_20250707_235239.png) | Linked to https://invent.kde.org/teams/plasma-mobile/issues/-/issues/307 **Note for Reviewer**: In my local environment, i need to add manually the KAuth files otherwise polkit not recognize the implementation. ``` sudo cp ~/kde/usr/share/dbus-1/system-services/org.kde.plasma.mobileshell.waydroidhelper.service /usr/share/dbus-1/system-services/ sudo cp ~/kde/usr/share/dbus-1/system.d/org.kde.plasma.mobileshell.waydroidhelper.conf /usr/share/dbus-1/system.d/ sudo cp ~/kde/usr/share/polkit-1/actions/org.kde.plasma.mobileshell.waydroidhelper.policy /usr/share/polkit-1/actions/ ```
2025-07-10 16:00:41 +00:00
{
const QStringList arguments{u"prop"_s, u"set"_s, key, value};
auto process = QProcess(this);
process.start(WAYDROID_COMMAND, arguments);
process.waitForFinished();
kcm: Implement minimal Waydroid support I prefer create MR now to avoid biggest merge request. It add minimalist implementation: - First configuration of Waydroid - Stop / Start Waydroid session - Configure properties of Waydroid - Display current ip of Waydroid | Not installed | First initialization | initializing | SessionNotStarted | SessionStarting | SessionStarted | | ------ | ------ | ------ | ------ | ------ | ------ | | ![Copie_d_écran_20250705_162112](/uploads/66844057ee6c955803288993809616fa/Copie_d_écran_20250705_162112.png) | ![Copie_d_écran_20250707_234822](/uploads/133779f8d4a70551a321938a7193aa3d/Copie_d_écran_20250707_234822.png) | ![Copie_d_écran_20250707_234829](/uploads/bacecd42875e3afd48dba2f9472b0f13/Copie_d_écran_20250707_234829.png) | ![Copie_d_écran_20250707_234908](/uploads/c6eff9833e33f30797088e327fcf6ea3/Copie_d_écran_20250707_234908.png) | ![Copie_d_écran_20250707_234919](/uploads/1927e2334d7e3b5790e5fab9037feff7/Copie_d_écran_20250707_234919.png) | ![Copie_d_écran_20250707_235239](/uploads/9be45b0a7b5f988de0e9ac297a2447c8/Copie_d_écran_20250707_235239.png) | Linked to https://invent.kde.org/teams/plasma-mobile/issues/-/issues/307 **Note for Reviewer**: In my local environment, i need to add manually the KAuth files otherwise polkit not recognize the implementation. ``` sudo cp ~/kde/usr/share/dbus-1/system-services/org.kde.plasma.mobileshell.waydroidhelper.service /usr/share/dbus-1/system-services/ sudo cp ~/kde/usr/share/dbus-1/system.d/org.kde.plasma.mobileshell.waydroidhelper.conf /usr/share/dbus-1/system.d/ sudo cp ~/kde/usr/share/polkit-1/actions/org.kde.plasma.mobileshell.waydroidhelper.policy /usr/share/polkit-1/actions/ ```
2025-07-10 16:00:41 +00:00
return process.exitCode() == 0;
kcm: Implement minimal Waydroid support I prefer create MR now to avoid biggest merge request. It add minimalist implementation: - First configuration of Waydroid - Stop / Start Waydroid session - Configure properties of Waydroid - Display current ip of Waydroid | Not installed | First initialization | initializing | SessionNotStarted | SessionStarting | SessionStarted | | ------ | ------ | ------ | ------ | ------ | ------ | | ![Copie_d_écran_20250705_162112](/uploads/66844057ee6c955803288993809616fa/Copie_d_écran_20250705_162112.png) | ![Copie_d_écran_20250707_234822](/uploads/133779f8d4a70551a321938a7193aa3d/Copie_d_écran_20250707_234822.png) | ![Copie_d_écran_20250707_234829](/uploads/bacecd42875e3afd48dba2f9472b0f13/Copie_d_écran_20250707_234829.png) | ![Copie_d_écran_20250707_234908](/uploads/c6eff9833e33f30797088e327fcf6ea3/Copie_d_écran_20250707_234908.png) | ![Copie_d_écran_20250707_234919](/uploads/1927e2334d7e3b5790e5fab9037feff7/Copie_d_écran_20250707_234919.png) | ![Copie_d_écran_20250707_235239](/uploads/9be45b0a7b5f988de0e9ac297a2447c8/Copie_d_écran_20250707_235239.png) | Linked to https://invent.kde.org/teams/plasma-mobile/issues/-/issues/307 **Note for Reviewer**: In my local environment, i need to add manually the KAuth files otherwise polkit not recognize the implementation. ``` sudo cp ~/kde/usr/share/dbus-1/system-services/org.kde.plasma.mobileshell.waydroidhelper.service /usr/share/dbus-1/system-services/ sudo cp ~/kde/usr/share/dbus-1/system.d/org.kde.plasma.mobileshell.waydroidhelper.conf /usr/share/dbus-1/system.d/ sudo cp ~/kde/usr/share/polkit-1/actions/org.kde.plasma.mobileshell.waydroidhelper.policy /usr/share/polkit-1/actions/ ```
2025-07-10 16:00:41 +00:00
}
QString WaydroidDBusObject::extractRegExp(const QString text, const QRegularExpression regExp) const
kcm: Implement minimal Waydroid support I prefer create MR now to avoid biggest merge request. It add minimalist implementation: - First configuration of Waydroid - Stop / Start Waydroid session - Configure properties of Waydroid - Display current ip of Waydroid | Not installed | First initialization | initializing | SessionNotStarted | SessionStarting | SessionStarted | | ------ | ------ | ------ | ------ | ------ | ------ | | ![Copie_d_écran_20250705_162112](/uploads/66844057ee6c955803288993809616fa/Copie_d_écran_20250705_162112.png) | ![Copie_d_écran_20250707_234822](/uploads/133779f8d4a70551a321938a7193aa3d/Copie_d_écran_20250707_234822.png) | ![Copie_d_écran_20250707_234829](/uploads/bacecd42875e3afd48dba2f9472b0f13/Copie_d_écran_20250707_234829.png) | ![Copie_d_écran_20250707_234908](/uploads/c6eff9833e33f30797088e327fcf6ea3/Copie_d_écran_20250707_234908.png) | ![Copie_d_écran_20250707_234919](/uploads/1927e2334d7e3b5790e5fab9037feff7/Copie_d_écran_20250707_234919.png) | ![Copie_d_écran_20250707_235239](/uploads/9be45b0a7b5f988de0e9ac297a2447c8/Copie_d_écran_20250707_235239.png) | Linked to https://invent.kde.org/teams/plasma-mobile/issues/-/issues/307 **Note for Reviewer**: In my local environment, i need to add manually the KAuth files otherwise polkit not recognize the implementation. ``` sudo cp ~/kde/usr/share/dbus-1/system-services/org.kde.plasma.mobileshell.waydroidhelper.service /usr/share/dbus-1/system-services/ sudo cp ~/kde/usr/share/dbus-1/system.d/org.kde.plasma.mobileshell.waydroidhelper.conf /usr/share/dbus-1/system.d/ sudo cp ~/kde/usr/share/polkit-1/actions/org.kde.plasma.mobileshell.waydroidhelper.policy /usr/share/polkit-1/actions/ ```
2025-07-10 16:00:41 +00:00
{
const QRegularExpressionMatch match = regExp.match(text);
if (match.hasMatch() && match.lastCapturedIndex() > 0) {
return match.captured(match.lastCapturedIndex());
} else {
return "";
}
}
void WaydroidDBusObject::checkSessionStarting(const int limit, const int tried)
kcm: Implement minimal Waydroid support I prefer create MR now to avoid biggest merge request. It add minimalist implementation: - First configuration of Waydroid - Stop / Start Waydroid session - Configure properties of Waydroid - Display current ip of Waydroid | Not installed | First initialization | initializing | SessionNotStarted | SessionStarting | SessionStarted | | ------ | ------ | ------ | ------ | ------ | ------ | | ![Copie_d_écran_20250705_162112](/uploads/66844057ee6c955803288993809616fa/Copie_d_écran_20250705_162112.png) | ![Copie_d_écran_20250707_234822](/uploads/133779f8d4a70551a321938a7193aa3d/Copie_d_écran_20250707_234822.png) | ![Copie_d_écran_20250707_234829](/uploads/bacecd42875e3afd48dba2f9472b0f13/Copie_d_écran_20250707_234829.png) | ![Copie_d_écran_20250707_234908](/uploads/c6eff9833e33f30797088e327fcf6ea3/Copie_d_écran_20250707_234908.png) | ![Copie_d_écran_20250707_234919](/uploads/1927e2334d7e3b5790e5fab9037feff7/Copie_d_écran_20250707_234919.png) | ![Copie_d_écran_20250707_235239](/uploads/9be45b0a7b5f988de0e9ac297a2447c8/Copie_d_écran_20250707_235239.png) | Linked to https://invent.kde.org/teams/plasma-mobile/issues/-/issues/307 **Note for Reviewer**: In my local environment, i need to add manually the KAuth files otherwise polkit not recognize the implementation. ``` sudo cp ~/kde/usr/share/dbus-1/system-services/org.kde.plasma.mobileshell.waydroidhelper.service /usr/share/dbus-1/system-services/ sudo cp ~/kde/usr/share/dbus-1/system.d/org.kde.plasma.mobileshell.waydroidhelper.conf /usr/share/dbus-1/system.d/ sudo cp ~/kde/usr/share/polkit-1/actions/org.kde.plasma.mobileshell.waydroidhelper.policy /usr/share/polkit-1/actions/ ```
2025-07-10 16:00:41 +00:00
{
if (m_sessionStatus != SessionStarting) {
return;
}
const QString output = fetchSessionInfo();
const QString sessionMatchResult = extractRegExp(output, sessionRegExp);
if (sessionMatchResult.contains("RUNNING")) {
m_sessionStatus = SessionRunning;
Q_EMIT sessionStatusChanged();
} else if (tried == limit) {
m_sessionStatus = SessionStopped;
Q_EMIT sessionStatusChanged();
qCWarning(WAYDROIDINTEGRATIONPLUGIN) << "Failed to start the session after " << tried << " tries";
} else {
QTimer::singleShot(500, [this, tried, limit]() {
checkSessionStarting(limit, tried + 1);
});
}
}
2025-07-28 17:37:19 +00:00
QString WaydroidDBusObject::desktopFileDirectory()
2025-07-28 17:37:19 +00:00
{
auto dir = []() -> QString {
if (KSandbox::isFlatpak()) {
return qEnvironmentVariable("HOME") % u"/.local/share/applications/";
}
return QStandardPaths::writableLocation(QStandardPaths::ApplicationsLocation);
}();
QDir(dir).mkpath(QStringLiteral("."));
return dir;
}
bool WaydroidDBusObject::removeWaydroidApplications()
2025-07-28 17:37:19 +00:00
{
const QDir appsDir(desktopFileDirectory());
const auto fileInfos = appsDir.entryInfoList(QDir::Files);
if (fileInfos.length() < 1) {
return false;
}
bool allFileRemoved = true;
for (const auto &fileInfo : fileInfos) {
if (fileInfo.fileName().contains(QStringView(u".desktop"))) {
const KDesktopFile desktopFile(fileInfo.filePath());
const KConfigGroup configGroup = desktopFile.desktopGroup();
if (!configGroup.hasKey(u"Categories"_s)) {
continue;
}
const auto categories = configGroup.readEntry(u"Categories"_s);
if (!categories.contains(u"X-WayDroid-App"_s)) {
continue;
}
QFile file(fileInfo.filePath());
if (!file.remove()) {
allFileRemoved &= false;
qCWarning(WAYDROIDINTEGRATIONPLUGIN) << "Failed to remove: " << desktopFile.name();
}
}
}
return allFileRemoved;
}
void WaydroidDBusObject::refreshApplications()
{
if (m_sessionStatus != SessionRunning) {
// Clear existing applications when session is not running
for (const auto &appObject : m_applicationObjects) {
appObject->unregisterObject();
}
m_applicationObjects.clear();
return;
}
const QString output = fetchApplicationsList();
if (output.isEmpty()) {
return;
}
QTextStream inFile(const_cast<QString *>(&output), QIODevice::ReadOnly);
const auto newApplications = WaydroidApplicationDBusObject::parseApplicationsFromWaydroidLog(inFile);
// Create a map of existing applications by package name for efficient lookup
QMap<QString, int> existingAppMap;
for (int i = 0; i < m_applicationObjects.size(); ++i) {
const auto &application = m_applicationObjects[i];
existingAppMap.insert(application->packageName(), i);
}
QList<WaydroidApplicationDBusObject::Ptr> toInsert;
// Check which applications need to be added or are already present
for (const auto &application : newApplications) {
if (!application->name().isEmpty() && !application->packageName().isEmpty()) {
auto it = existingAppMap.find(application->packageName());
if (it != existingAppMap.end()) {
// Application already exists, remove from map to mark as kept
existingAppMap.erase(it);
} else {
// Application needs to be inserted
toInsert.append(application);
}
}
}
// Remove applications that are no longer present
QList<int> toRemove;
for (const int index : existingAppMap.values()) {
toRemove.append(index);
}
std::sort(toRemove.begin(), toRemove.end());
// Remove indices from end to start to avoid index shifting
for (int i = toRemove.size() - 1; i >= 0; --i) {
int ind = toRemove[i];
const auto application = m_applicationObjects[ind];
m_applicationObjects.removeAt(ind);
Q_EMIT applicationRemoved(application->objectPath());
application->unregisterObject();
}
// Add new applications and register them
for (const auto &application : toInsert) {
application->registerObject();
m_applicationObjects.append(application);
Q_EMIT applicationAdded(application->objectPath());
}
}
QString WaydroidDBusObject::fetchApplicationsList()
{
const QStringList arguments{u"app"_s, u"list"_s};
auto process = QProcess(this);
process.start(WAYDROID_COMMAND, arguments);
process.waitForFinished();
if (process.exitCode() != 0) {
qCWarning(WAYDROIDINTEGRATIONPLUGIN) << "Failed to fetch applications list: " << process.readAllStandardError();
return QString{};
}
return process.readAllStandardOutput();
}