mirror of
https://github.com/KDE/kdeconnect-android
synced 2025-09-02 07:05:09 +00:00
Compare commits
8 Commits
kdeconnect
...
v1.24.1
Author | SHA1 | Date | |
---|---|---|---|
|
61190189ec | ||
|
4c6cda711f | ||
|
64b32003cc | ||
|
39fb60b81b | ||
|
431312fcd0 | ||
|
6c8c6dd63e | ||
|
8aeefded7c | ||
|
e2dbc39e3a |
8
.idea/.gitignore
generated
vendored
8
.idea/.gitignore
generated
vendored
@@ -1,8 +0,0 @@
|
|||||||
# Default ignored files
|
|
||||||
/shelf/
|
|
||||||
/workspace.xml
|
|
||||||
# Editor-based HTTP Client requests
|
|
||||||
/httpRequests/
|
|
||||||
# Datasource local storage ignored files
|
|
||||||
/dataSources/
|
|
||||||
/dataSources.local.xml
|
|
BIN
.idea/icon.png
generated
BIN
.idea/icon.png
generated
Binary file not shown.
Before Width: | Height: | Size: 4.2 KiB |
@@ -2,8 +2,8 @@
|
|||||||
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
|
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
|
||||||
xmlns:tools="http://schemas.android.com/tools"
|
xmlns:tools="http://schemas.android.com/tools"
|
||||||
package="org.kde.kdeconnect_tp"
|
package="org.kde.kdeconnect_tp"
|
||||||
android:versionCode="12400"
|
android:versionCode="12401"
|
||||||
android:versionName="1.24.0">
|
android:versionName="1.24.1">
|
||||||
|
|
||||||
<supports-screens
|
<supports-screens
|
||||||
android:anyDensity="true"
|
android:anyDensity="true"
|
||||||
|
12
build.gradle
12
build.gradle
@@ -4,7 +4,7 @@ import com.android.build.gradle.api.ApplicationVariant
|
|||||||
import com.github.jk1.license.render.TextReportRenderer
|
import com.github.jk1.license.render.TextReportRenderer
|
||||||
|
|
||||||
buildscript {
|
buildscript {
|
||||||
ext.kotlin_version = '1.8.0'
|
ext.kotlin_version = '1.8.10'
|
||||||
dependencies {
|
dependencies {
|
||||||
classpath 'com.android.tools.build:gradle:7.4.2'
|
classpath 'com.android.tools.build:gradle:7.4.2'
|
||||||
classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version"
|
classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version"
|
||||||
@@ -136,19 +136,19 @@ ext {
|
|||||||
}
|
}
|
||||||
|
|
||||||
dependencies {
|
dependencies {
|
||||||
coreLibraryDesugaring 'com.android.tools:desugar_jdk_libs:2.0.2'
|
coreLibraryDesugaring 'com.android.tools:desugar_jdk_libs:2.0.3'
|
||||||
|
|
||||||
implementation 'androidx.media:media:1.6.0'
|
implementation 'androidx.media:media:1.6.0'
|
||||||
implementation 'androidx.appcompat:appcompat:1.6.1'
|
implementation 'androidx.appcompat:appcompat:1.6.1'
|
||||||
implementation 'androidx.core:core-ktx:1.9.0'
|
implementation 'androidx.core:core-ktx:1.10.0'
|
||||||
implementation 'androidx.preference:preference-ktx:1.2.0'
|
implementation 'androidx.preference:preference-ktx:1.2.0'
|
||||||
implementation 'androidx.recyclerview:recyclerview:1.3.0'
|
implementation 'androidx.recyclerview:recyclerview:1.3.0'
|
||||||
implementation 'androidx.swiperefreshlayout:swiperefreshlayout:1.1.0'
|
implementation 'androidx.swiperefreshlayout:swiperefreshlayout:1.1.0'
|
||||||
implementation 'androidx.documentfile:documentfile:1.0.1'
|
implementation 'androidx.documentfile:documentfile:1.0.1'
|
||||||
implementation "androidx.lifecycle:lifecycle-viewmodel-ktx:2.6.0"
|
implementation "androidx.lifecycle:lifecycle-viewmodel-ktx:2.6.1"
|
||||||
implementation 'androidx.lifecycle:lifecycle-runtime-ktx:2.6.0'
|
implementation 'androidx.lifecycle:lifecycle-runtime-ktx:2.6.1'
|
||||||
implementation "androidx.lifecycle:lifecycle-extensions:2.2.0"
|
implementation "androidx.lifecycle:lifecycle-extensions:2.2.0"
|
||||||
implementation 'androidx.lifecycle:lifecycle-common-java8:2.6.0'
|
implementation 'androidx.lifecycle:lifecycle-common-java8:2.6.1'
|
||||||
implementation 'androidx.gridlayout:gridlayout:1.0.0'
|
implementation 'androidx.gridlayout:gridlayout:1.0.0'
|
||||||
implementation 'com.google.android.material:material:1.8.0'
|
implementation 'com.google.android.material:material:1.8.0'
|
||||||
implementation 'com.jakewharton:disklrucache:2.0.2' //For caching album art bitmaps
|
implementation 'com.jakewharton:disklrucache:2.0.2' //For caching album art bitmaps
|
||||||
|
@@ -209,7 +209,7 @@ public class SslHelper {
|
|||||||
trustManagerFactory.init(keyStore);
|
trustManagerFactory.init(keyStore);
|
||||||
|
|
||||||
// Setup custom trust manager if device not trusted
|
// Setup custom trust manager if device not trusted
|
||||||
SSLContext tlsContext = SSLContext.getInstance("TLSv1"); //Newer TLS versions are only supported on API 16+
|
SSLContext tlsContext = SSLContext.getInstance("TLS");
|
||||||
if (isDeviceTrusted) {
|
if (isDeviceTrusted) {
|
||||||
tlsContext.init(keyManagerFactory.getKeyManagers(), trustManagerFactory.getTrustManagers(), RandomHelper.secureRandom);
|
tlsContext.init(keyManagerFactory.getKeyManagers(), trustManagerFactory.getTrustManagers(), RandomHelper.secureRandom);
|
||||||
} else {
|
} else {
|
||||||
|
@@ -151,6 +151,7 @@ public class FindMyPhonePlugin extends Plugin {
|
|||||||
.setFullScreenIntent(pendingIntent, true)
|
.setFullScreenIntent(pendingIntent, true)
|
||||||
.setPriority(NotificationCompat.PRIORITY_HIGH)
|
.setPriority(NotificationCompat.PRIORITY_HIGH)
|
||||||
.setAutoCancel(true)
|
.setAutoCancel(true)
|
||||||
|
.setOngoing(true)
|
||||||
.setContentTitle(context.getString(R.string.findmyphone_found));
|
.setContentTitle(context.getString(R.string.findmyphone_found));
|
||||||
notification.setGroup("BackgroundService");
|
notification.setGroup("BackgroundService");
|
||||||
|
|
||||||
|
@@ -61,8 +61,8 @@ class DeviceFragment : Fragment() {
|
|||||||
*
|
*
|
||||||
* Used to start and retry pairing.
|
* Used to start and retry pairing.
|
||||||
*/
|
*/
|
||||||
private var binding: ViewPairRequestBinding? = null
|
private var pairingBinding: ViewPairRequestBinding? = null
|
||||||
private fun requireBinding() = binding ?: throw IllegalStateException("binding is not set")
|
private fun requirePairingBinding() = pairingBinding ?: throw IllegalStateException("binding is not set")
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Cannot-communicate ViewBinding.
|
* Cannot-communicate ViewBinding.
|
||||||
@@ -94,7 +94,7 @@ class DeviceFragment : Fragment() {
|
|||||||
val deviceBinding = deviceBinding ?: return null
|
val deviceBinding = deviceBinding ?: return null
|
||||||
|
|
||||||
// Inner binding for the layout shown when we're not paired yet...
|
// Inner binding for the layout shown when we're not paired yet...
|
||||||
binding = deviceBinding.pairRequest
|
pairingBinding = deviceBinding.pairRequest
|
||||||
// ...and for when pairing doesn't (or can't) work
|
// ...and for when pairing doesn't (or can't) work
|
||||||
errorBinding = deviceBinding.pairError
|
errorBinding = deviceBinding.pairError
|
||||||
|
|
||||||
@@ -102,8 +102,8 @@ class DeviceFragment : Fragment() {
|
|||||||
device = it.getDevice(deviceId)
|
device = it.getDevice(deviceId)
|
||||||
}
|
}
|
||||||
|
|
||||||
requireBinding().pairButton.setOnClickListener {
|
requirePairingBinding().pairButton.setOnClickListener {
|
||||||
with(requireBinding()) {
|
with(requirePairingBinding()) {
|
||||||
pairButton.visibility = View.GONE
|
pairButton.visibility = View.GONE
|
||||||
pairMessage.text = null
|
pairMessage.text = null
|
||||||
pairVerification.visibility = View.VISIBLE
|
pairVerification.visibility = View.VISIBLE
|
||||||
@@ -112,13 +112,13 @@ class DeviceFragment : Fragment() {
|
|||||||
}
|
}
|
||||||
device?.requestPairing()
|
device?.requestPairing()
|
||||||
}
|
}
|
||||||
requireBinding().acceptButton.setOnClickListener {
|
requirePairingBinding().acceptButton.setOnClickListener {
|
||||||
device?.apply {
|
device?.apply {
|
||||||
acceptPairing()
|
acceptPairing()
|
||||||
requireBinding().pairingButtons.visibility = View.GONE
|
requirePairingBinding().pairingButtons.visibility = View.GONE
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
requireBinding().rejectButton.setOnClickListener {
|
requirePairingBinding().rejectButton.setOnClickListener {
|
||||||
device?.apply {
|
device?.apply {
|
||||||
//Remove listener so buttons don't show for a while before changing the view
|
//Remove listener so buttons don't show for a while before changing the view
|
||||||
removePluginsChangedListener(pluginsChangedListener)
|
removePluginsChangedListener(pluginsChangedListener)
|
||||||
@@ -155,7 +155,7 @@ class DeviceFragment : Fragment() {
|
|||||||
device.removePairingCallback(pairingCallback)
|
device.removePairingCallback(pairingCallback)
|
||||||
}
|
}
|
||||||
super.onDestroyView()
|
super.onDestroyView()
|
||||||
binding = null
|
pairingBinding = null
|
||||||
errorBinding = null
|
errorBinding = null
|
||||||
deviceBinding = null
|
deviceBinding = null
|
||||||
}
|
}
|
||||||
@@ -243,28 +243,36 @@ class DeviceFragment : Fragment() {
|
|||||||
mActivity?.runOnUiThread(object : Runnable {
|
mActivity?.runOnUiThread(object : Runnable {
|
||||||
override fun run() {
|
override fun run() {
|
||||||
if (device.isPairRequestedByPeer) {
|
if (device.isPairRequestedByPeer) {
|
||||||
requireBinding().pairMessage.setText(R.string.pair_requested)
|
with (requirePairingBinding()) {
|
||||||
requireBinding().pairVerification.visibility = View.VISIBLE
|
pairMessage.setText(R.string.pair_requested)
|
||||||
requireBinding().pairVerification.text =
|
pairVerification.visibility = View.VISIBLE
|
||||||
SslHelper.getVerificationKey(SslHelper.certificate, device.certificate)
|
pairVerification.text = SslHelper.getVerificationKey(SslHelper.certificate, device.certificate)
|
||||||
requireBinding().pairingButtons.visibility = View.VISIBLE
|
pairingButtons.visibility = View.VISIBLE
|
||||||
requireBinding().pairProgress.visibility = View.GONE
|
pairProgress.visibility = View.GONE
|
||||||
requireBinding().pairButton.visibility = View.GONE
|
pairButton.visibility = View.GONE
|
||||||
requireBinding().pairRequestButtons.visibility = View.VISIBLE
|
pairRequestButtons.visibility = View.VISIBLE
|
||||||
|
}
|
||||||
|
with (requireDeviceBinding()) {
|
||||||
|
permissionsList.visibility = View.GONE
|
||||||
|
pluginsList.visibility = View.GONE
|
||||||
|
}
|
||||||
} else {
|
} else {
|
||||||
val paired = device.isPaired
|
val paired = device.isPaired
|
||||||
val reachable = device.isReachable
|
val reachable = device.isReachable
|
||||||
requireBinding().pairingButtons.visibility = if (paired) View.GONE else View.VISIBLE
|
requirePairingBinding().pairingButtons.visibility = if (paired) View.GONE else View.VISIBLE
|
||||||
if (paired && !reachable) {
|
if (paired && !reachable) {
|
||||||
requireErrorBinding().errorMessageContainer.visibility = View.VISIBLE
|
requireErrorBinding().errorMessageContainer.visibility = View.VISIBLE
|
||||||
requireErrorBinding().notReachableMessage.visibility = View.VISIBLE
|
requireErrorBinding().notReachableMessage.visibility = View.VISIBLE
|
||||||
requireDeviceBinding().permissionsList.visibility = View.GONE
|
requireDeviceBinding().permissionsList.visibility = View.GONE
|
||||||
requireDeviceBinding().pluginsList.visibility = View.GONE
|
requireDeviceBinding().pluginsList.visibility = View.GONE
|
||||||
} else {
|
} else if (paired) {
|
||||||
requireErrorBinding().errorMessageContainer.visibility = View.GONE
|
requireErrorBinding().errorMessageContainer.visibility = View.GONE
|
||||||
requireErrorBinding().notReachableMessage.visibility = View.GONE
|
requireErrorBinding().notReachableMessage.visibility = View.GONE
|
||||||
requireDeviceBinding().permissionsList.visibility = View.VISIBLE
|
requireDeviceBinding().permissionsList.visibility = View.VISIBLE
|
||||||
requireDeviceBinding().pluginsList.visibility = View.VISIBLE
|
requireDeviceBinding().pluginsList.visibility = View.VISIBLE
|
||||||
|
} else {
|
||||||
|
requireDeviceBinding().permissionsList.visibility = View.GONE
|
||||||
|
requireDeviceBinding().pluginsList.visibility = View.GONE
|
||||||
}
|
}
|
||||||
try {
|
try {
|
||||||
if (paired && reachable) {
|
if (paired && reachable) {
|
||||||
@@ -332,7 +340,7 @@ class DeviceFragment : Fragment() {
|
|||||||
|
|
||||||
override fun pairingFailed(error: String) {
|
override fun pairingFailed(error: String) {
|
||||||
mActivity?.runOnUiThread {
|
mActivity?.runOnUiThread {
|
||||||
with(requireBinding()) {
|
with(requirePairingBinding()) {
|
||||||
pairMessage.text = error
|
pairMessage.text = error
|
||||||
pairVerification.text = null
|
pairVerification.text = null
|
||||||
pairVerification.visibility = View.GONE
|
pairVerification.visibility = View.GONE
|
||||||
@@ -346,7 +354,7 @@ class DeviceFragment : Fragment() {
|
|||||||
|
|
||||||
override fun unpaired() {
|
override fun unpaired() {
|
||||||
mActivity?.runOnUiThread {
|
mActivity?.runOnUiThread {
|
||||||
with(requireBinding()) {
|
with(requirePairingBinding()) {
|
||||||
pairMessage.setText(R.string.device_not_paired)
|
pairMessage.setText(R.string.device_not_paired)
|
||||||
pairVerification.visibility = View.GONE
|
pairVerification.visibility = View.GONE
|
||||||
pairProgress.visibility = View.GONE
|
pairProgress.visibility = View.GONE
|
||||||
|
Reference in New Issue
Block a user