mirror of
https://github.com/KDE/kdeconnect-android
synced 2025-08-22 01:51:47 +00:00
Allow for debugging on the same device
This change builds separate debugging app with a different ID which can be installed alongside the release version.
This commit is contained in:
parent
b0c9e46a31
commit
fa22722498
@ -359,7 +359,7 @@ SPDX-License-Identifier: GPL-2.0-only OR GPL-3.0-only OR LicenseRef-KDE-Accepted
|
||||
|
||||
<provider
|
||||
android:name="androidx.core.content.FileProvider"
|
||||
android:authorities="org.kde.kdeconnect_tp.fileprovider"
|
||||
android:authorities="${applicationId}.fileprovider"
|
||||
android:exported="false"
|
||||
android:grantUriPermissions="true">
|
||||
<meta-data
|
||||
|
@ -27,6 +27,7 @@ plugins {
|
||||
}
|
||||
|
||||
val licenseResDir = File("$projectDir/build/dependency-license-res")
|
||||
val debugSuffix = "debugging_edition"
|
||||
|
||||
fun String.runCommand(
|
||||
workingDir: File = File("."),
|
||||
@ -82,6 +83,13 @@ android {
|
||||
res.setSrcDirs(listOf(licenseResDir, "res"))
|
||||
assets.setSrcDirs(listOf("assets"))
|
||||
}
|
||||
getByName("debug") {
|
||||
manifest.srcFile("AndroidManifest.xml")
|
||||
java.setSrcDirs(listOf("src"))
|
||||
resources.setSrcDirs(listOf("resources"))
|
||||
res.setSrcDirs(listOf(licenseResDir, "dbg-res"))
|
||||
assets.setSrcDirs(listOf("assets"))
|
||||
}
|
||||
getByName("test") {
|
||||
java.setSrcDirs(listOf("tests"))
|
||||
}
|
||||
@ -105,6 +113,8 @@ android {
|
||||
isMinifyEnabled = false
|
||||
isShrinkResources = false
|
||||
signingConfig = signingConfigs.getByName("debug")
|
||||
applicationIdSuffix = ".$debugSuffix"
|
||||
versionNameSuffix = "-$debugSuffix"
|
||||
}
|
||||
getByName("release") {
|
||||
isMinifyEnabled = true
|
||||
|
6
dbg-res/mipmap-anydpi-v26/ic_launcher.xml
Normal file
6
dbg-res/mipmap-anydpi-v26/ic_launcher.xml
Normal file
@ -0,0 +1,6 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<adaptive-icon xmlns:android="http://schemas.android.com/apk/res/android">
|
||||
<!-- <background android:drawable="@drawable/ic_launcher_background"/>-->
|
||||
<foreground android:drawable="@drawable/ic_launcher_foreground"/>
|
||||
<monochrome android:drawable="@drawable/ic_launcher_monochrome"/>
|
||||
</adaptive-icon>
|
5
dbg-res/mipmap-anydpi-v26/ic_launcher_banner.xml
Normal file
5
dbg-res/mipmap-anydpi-v26/ic_launcher_banner.xml
Normal file
@ -0,0 +1,5 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<adaptive-icon xmlns:android="http://schemas.android.com/apk/res/android">
|
||||
<!-- <background android:drawable="@drawable/ic_launcher_banner_background"/>-->
|
||||
<foreground android:drawable="@drawable/ic_launcher_banner_foreground"/>
|
||||
</adaptive-icon>
|
6
dbg-res/mipmap-anydpi-v26/ic_launcher_round.xml
Normal file
6
dbg-res/mipmap-anydpi-v26/ic_launcher_round.xml
Normal file
@ -0,0 +1,6 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<adaptive-icon xmlns:android="http://schemas.android.com/apk/res/android">
|
||||
<!-- <background android:drawable="@drawable/ic_launcher_background"/>-->
|
||||
<foreground android:drawable="@drawable/ic_launcher_foreground"/>
|
||||
<monochrome android:drawable="@drawable/ic_launcher_monochrome"/>
|
||||
</adaptive-icon>
|
11
dbg-res/values/strings.xml
Normal file
11
dbg-res/values/strings.xml
Normal file
@ -0,0 +1,11 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
|
||||
<!--
|
||||
SPDX-FileCopyrightText: 2024 TPJ Schikhof <kde@schikhof.eu>
|
||||
|
||||
SPDX-License-Identifier: GPL-2.0-only OR GPL-3.0-only OR LicenseRef-KDE-Accepted-GPL
|
||||
-->
|
||||
|
||||
<resources>
|
||||
<string name="kde_connect">KDE Connect Debug</string>
|
||||
</resources>
|
@ -32,6 +32,7 @@ import org.kde.kdeconnect.Backends.BaseLinkProvider
|
||||
import org.kde.kdeconnect.Backends.BaseLinkProvider.ConnectionReceiver
|
||||
import org.kde.kdeconnect.Backends.BluetoothBackend.BluetoothLinkProvider
|
||||
import org.kde.kdeconnect.Backends.LanBackend.LanLinkProvider
|
||||
import org.kde.kdeconnect.Backends.LoopbackBackend.LoopbackLinkProvider
|
||||
import org.kde.kdeconnect.Helpers.NotificationHelper
|
||||
import org.kde.kdeconnect.Plugins.ClibpoardPlugin.ClipboardFloatingActivity
|
||||
import org.kde.kdeconnect.Plugins.RunCommandPlugin.RunCommandActivity
|
||||
@ -50,7 +51,7 @@ import org.kde.kdeconnect_tp.R
|
||||
class BackgroundService : Service() {
|
||||
private lateinit var applicationInstance: KdeConnect
|
||||
|
||||
private val linkProviders = ArrayList<BaseLinkProvider>()
|
||||
private val linkProviders = mutableListOf<BaseLinkProvider>()
|
||||
|
||||
private val connectedToNonCellularNetwork = MutableLiveData<Boolean>()
|
||||
/** Indicates whether device is connected over wifi / usb / bluetooth / (anything other than cellular) */
|
||||
@ -148,8 +149,8 @@ class BackgroundService : Service() {
|
||||
private fun createForegroundNotification(): Notification {
|
||||
// Why is this needed: https://developer.android.com/guide/components/services#Foreground
|
||||
|
||||
val connectedDevices = ArrayList<String>()
|
||||
val connectedDeviceIds = ArrayList<String>()
|
||||
val connectedDevices = mutableListOf<String>()
|
||||
val connectedDeviceIds = mutableListOf<String>()
|
||||
for (device in applicationInstance.devices.values) {
|
||||
if (device.isReachable && device.isPaired) {
|
||||
connectedDeviceIds.add(device.deviceId)
|
||||
|
Loading…
x
Reference in New Issue
Block a user