2025-07-10 16:57:34 +00:00
/ *
* SPDX - FileCopyrightText: 2025 Florian RICHER < florian . richer @ protonmail . com >
* SPDX - License - Identifier: LGPL - 2.0 - or - later
* /
import QtQuick
import QtQuick . Layouts
import QtQuick . Controls as QQC2
2026-03-07 03:08:07 +00:00
import org . kde . kirigami as Kirigami
2025-07-10 16:57:34 +00:00
import org . kde . kcmutils as KCM
import org . kde . kirigamiaddons . formcard 1.0 as FormCard
import org . kde . plasma . private . mobileshell . waydroidintegrationplugin as AIP
KCM . SimpleKCM {
id: root
topPadding: 0
bottomPadding: 0
leftPadding: 0
rightPadding: 0
title: i18n ( "Google Play Protect configuration" )
Component.onCompleted: {
2025-08-06 20:06:17 +00:00
if ( AIP . WaydroidDBusClient . androidId === "" ) {
AIP . WaydroidDBusClient . refreshAndroidId ( )
2025-07-10 16:57:34 +00:00
}
}
WaydroidLoader {
2025-08-06 20:06:17 +00:00
visible: AIP . WaydroidDBusClient . androidId === ""
2025-12-27 13:57:22 +00:00
text: i18n ( "Fetching your Android ID.\nIt can take a few seconds." )
2025-07-10 16:57:34 +00:00
}
2025-08-14 21:38:53 +00:00
Connections {
target: AIP . WaydroidDBusClient
function onActionFailed ( error: string ) : void {
inlineMessage . text = error
inlineMessage . visible = true
inlineMessage . type = Kirigami . MessageType . Error
}
}
Kirigami . InlineMessage {
id: inlineMessage
Layout.fillWidth: true
visible: false
showCloseButton: true
}
2025-07-10 16:57:34 +00:00
ColumnLayout {
2025-08-06 20:06:17 +00:00
visible: AIP . WaydroidDBusClient . androidId !== ""
2025-07-10 16:57:34 +00:00
anchors.verticalCenter: parent . verticalCenter
anchors.left: parent
anchors.leftMargin: Kirigami . Units . largeSpacing
anchors.right: parent
anchors.rightMargin: Kirigami . Units . largeSpacing
spacing: Kirigami . Units . largeSpacing
Kirigami . PlaceholderMessage {
2025-12-27 13:57:22 +00:00
explanation: i18n ( "When launching Waydroid with GAPPS for the first time, you will be notified that the device is not certified for Google Play Protect. To self certify your device, paste the Android ID in the field on the website. Then, give the Google services some minutes to reflect the change and restart Waydroid." )
2025-07-10 16:57:34 +00:00
Layout.fillWidth: true
}
QQC2 . Button {
text: i18nc ( "@action:button" , "Copy Android ID and open the website" )
icon.name: 'edit-copy-symbolic'
Layout.alignment: Qt . AlignHCenter
onClicked: {
2025-08-06 20:06:17 +00:00
AIP . WaydroidDBusClient . copyToClipboard ( AIP . WaydroidDBusClient . androidId )
2025-07-10 16:57:34 +00:00
Qt . openUrlExternally ( "https://www.google.com/android/uncertified" )
}
}
}
2026-03-07 03:08:07 +00:00
}