diff --git a/.github/ISSUE_TEMPLATE/bug_report.yaml b/.github/ISSUE_TEMPLATE/bug_report.yaml
index a559e42e..4ec7b155 100644
--- a/.github/ISSUE_TEMPLATE/bug_report.yaml
+++ b/.github/ISSUE_TEMPLATE/bug_report.yaml
@@ -32,6 +32,7 @@ body:
description: Specify the version of AdvancedSharpAdbClient you're using.
options:
- "Latest Source"
+ - "2.5.6"
- "2.5.5"
- "2.5.4"
- "2.5.3"
diff --git a/AdvancedSharpAdbClient/AdbCommandLineClient.cs b/AdvancedSharpAdbClient/AdbCommandLineClient.cs
index d5fa2d57..dab6036d 100644
--- a/AdvancedSharpAdbClient/AdbCommandLineClient.cs
+++ b/AdvancedSharpAdbClient/AdbCommandLineClient.cs
@@ -130,7 +130,7 @@ public void StartServer()
return;
}
-#if HAS_Process
+#if HAS_PROCESS
// Starting the adb server failed for whatever reason. This can happen if adb.exe
// is running but is not accepting requests. In that case, try to kill it & start again.
// It kills all processes named "adb", so let's hope nobody else named their process that way.
diff --git a/AdvancedSharpAdbClient/AdvancedSharpAdbClient.csproj b/AdvancedSharpAdbClient/AdvancedSharpAdbClient.csproj
index 1b58c7a0..02a7d906 100644
--- a/AdvancedSharpAdbClient/AdvancedSharpAdbClient.csproj
+++ b/AdvancedSharpAdbClient/AdvancedSharpAdbClient.csproj
@@ -97,14 +97,14 @@
or '$(TargetFramework)' == 'net8.0'
or '$(TargetFramework)' == 'netcoreapp3.1'
or '$(TargetFramework)' == 'netstandard2.1'">
- $(DefineConstants);HAS_IndexRange
+ $(DefineConstants);HAS_INDEXRANGE
- $(DefineConstants);HAS_Process;HAS_Drawing;HAS_Serialization
+ $(DefineConstants);HAS_PROCESS;HAS_DRAWING;HAS_SERIALIZATION
diff --git a/AdvancedSharpAdbClient/DeviceCommands/LinuxPath.cs b/AdvancedSharpAdbClient/DeviceCommands/LinuxPath.cs
index c0f08e5f..79500862 100644
--- a/AdvancedSharpAdbClient/DeviceCommands/LinuxPath.cs
+++ b/AdvancedSharpAdbClient/DeviceCommands/LinuxPath.cs
@@ -61,7 +61,7 @@ public static string Combine(params string[] paths)
{
capacity += paths[i].Length;
}
-#if HAS_IndexRange
+#if HAS_INDEXRANGE
char ch = paths[i][^1];
#else
char ch = paths[i][paths[i].Length - 1];
@@ -84,7 +84,7 @@ public static string Combine(params string[] paths)
}
else
{
-#if HAS_IndexRange
+#if HAS_INDEXRANGE
char ch2 = builder[^1];
#else
char ch2 = builder[builder.Length - 1];
@@ -131,7 +131,7 @@ public static string GetDirectoryName(string path)
{
return tpath;
}
-#if HAS_IndexRange
+#if HAS_INDEXRANGE
tpath = tpath[..(tpath.LastIndexOf(DirectorySeparatorChar) + 1)];
#else
tpath = tpath.Substring(0, tpath.LastIndexOf(DirectorySeparatorChar) + 1);
diff --git a/AdvancedSharpAdbClient/DeviceCommands/Models/AndroidProcess.cs b/AdvancedSharpAdbClient/DeviceCommands/Models/AndroidProcess.cs
index b4a67f27..c7dcc21d 100644
--- a/AdvancedSharpAdbClient/DeviceCommands/Models/AndroidProcess.cs
+++ b/AdvancedSharpAdbClient/DeviceCommands/Models/AndroidProcess.cs
@@ -343,7 +343,7 @@ public static AndroidProcess Parse(string line, bool cmdLinePrefix = false)
if (cmdLinePrefix)
{
-#if HAS_IndexRange
+#if HAS_INDEXRANGE
string[] cmdLineParts = line[..processNameStart]
#else
@@ -357,7 +357,7 @@ public static AndroidProcess Parse(string line, bool cmdLinePrefix = false)
}
else
{
-#if HAS_IndexRange
+#if HAS_INDEXRANGE
pid = int.Parse(cmdLineParts[^1]);
#else
pid = int.Parse(cmdLineParts[cmdLineParts.Length - 1]);
@@ -374,7 +374,7 @@ public static AndroidProcess Parse(string line, bool cmdLinePrefix = false)
if (!parsedCmdLinePrefix)
{
-#if HAS_IndexRange
+#if HAS_INDEXRANGE
pid = int.Parse(line[..processNameStart]);
#else
pid = int.Parse(line.Substring(0, processNameStart));
@@ -385,7 +385,7 @@ public static AndroidProcess Parse(string line, bool cmdLinePrefix = false)
process.Name = comm;
}
-#if HAS_IndexRange
+#if HAS_INDEXRANGE
string[] parts = line[(processNameEnd + 1)..]
#else
string[] parts = line.Substring(processNameEnd + 1)
diff --git a/AdvancedSharpAdbClient/DeviceCommands/Receivers/PackageManagerReceiver.cs b/AdvancedSharpAdbClient/DeviceCommands/Receivers/PackageManagerReceiver.cs
index d339a725..af59b8b4 100644
--- a/AdvancedSharpAdbClient/DeviceCommands/Receivers/PackageManagerReceiver.cs
+++ b/AdvancedSharpAdbClient/DeviceCommands/Receivers/PackageManagerReceiver.cs
@@ -49,7 +49,7 @@ protected override void ProcessNewLines(IEnumerable lines)
// package:mwc2015.be
// Remove the "package:" prefix
-#if HAS_IndexRange
+#if HAS_INDEXRANGE
string package = line[8..];
#else
string package = line.Substring(8);
@@ -67,7 +67,7 @@ protected override void ProcessNewLines(IEnumerable lines)
}
else
{
-#if HAS_IndexRange
+#if HAS_INDEXRANGE
string path = package[..separator];
string name = package[(separator + 1)..];
#else
diff --git a/AdvancedSharpAdbClient/DeviceCommands/Receivers/VersionInfoReceiver.cs b/AdvancedSharpAdbClient/DeviceCommands/Receivers/VersionInfoReceiver.cs
index 26970346..fcb23837 100644
--- a/AdvancedSharpAdbClient/DeviceCommands/Receivers/VersionInfoReceiver.cs
+++ b/AdvancedSharpAdbClient/DeviceCommands/Receivers/VersionInfoReceiver.cs
@@ -80,7 +80,7 @@ internal object GetVersionName(string line)
return !inPackagesSection ? null
: line != null && line.Trim().StartsWith("versionName=")
-#if HAS_IndexRange
+#if HAS_INDEXRANGE
? line.Trim()[12..].Trim() : null;
#else
? line.Trim().Substring(12).Trim() : null;
diff --git a/AdvancedSharpAdbClient/DeviceMonitor.cs b/AdvancedSharpAdbClient/DeviceMonitor.cs
index df0f5e5d..f3871479 100644
--- a/AdvancedSharpAdbClient/DeviceMonitor.cs
+++ b/AdvancedSharpAdbClient/DeviceMonitor.cs
@@ -158,7 +158,7 @@ public void Dispose()
monitorTaskCancellationTokenSource.Cancel();
monitorTask.Wait();
-#if HAS_Process
+#if HAS_PROCESS
monitorTask.Dispose();
#endif
monitorTask = null;
diff --git a/AdvancedSharpAdbClient/Exceptions/AdbException.cs b/AdvancedSharpAdbClient/Exceptions/AdbException.cs
index eb731565..d58757dc 100644
--- a/AdvancedSharpAdbClient/Exceptions/AdbException.cs
+++ b/AdvancedSharpAdbClient/Exceptions/AdbException.cs
@@ -5,7 +5,7 @@
using System;
using System.Net.Sockets;
-#if HAS_Serialization
+#if HAS_SERIALIZATION
using System.Runtime.Serialization;
#endif
@@ -49,7 +49,7 @@ public AdbException(string message, AdbResponse response) : base(message)
Response = response;
}
-#if HAS_Serialization
+#if HAS_SERIALIZATION
///
/// Initializes a new instance of the class.
///
diff --git a/AdvancedSharpAdbClient/Exceptions/CommandAbortingException.cs b/AdvancedSharpAdbClient/Exceptions/CommandAbortingException.cs
index 90be0d23..58e06084 100644
--- a/AdvancedSharpAdbClient/Exceptions/CommandAbortingException.cs
+++ b/AdvancedSharpAdbClient/Exceptions/CommandAbortingException.cs
@@ -4,7 +4,7 @@
using System;
-#if HAS_Serialization
+#if HAS_SERIALIZATION
using System.Runtime.Serialization;
#endif
@@ -30,7 +30,7 @@ public CommandAbortingException(string message) : base(message)
{
}
-#if HAS_Serialization
+#if HAS_SERIALIZATION
///
/// Initializes a new instance of the class.
///
diff --git a/AdvancedSharpAdbClient/Exceptions/DeviceNotFoundException.cs b/AdvancedSharpAdbClient/Exceptions/DeviceNotFoundException.cs
index ce55c425..6e00f886 100644
--- a/AdvancedSharpAdbClient/Exceptions/DeviceNotFoundException.cs
+++ b/AdvancedSharpAdbClient/Exceptions/DeviceNotFoundException.cs
@@ -4,7 +4,7 @@
using System;
-#if HAS_Serialization
+#if HAS_SERIALIZATION
using System.Runtime.Serialization;
#endif
@@ -39,7 +39,7 @@ public DeviceNotFoundException(string message, Exception innerException) : base(
{
}
-#if HAS_Serialization
+#if HAS_SERIALIZATION
///
/// Initializes a new instance of the class.
///
diff --git a/AdvancedSharpAdbClient/Exceptions/ExceptionExtensions.cs b/AdvancedSharpAdbClient/Exceptions/ExceptionExtensions.cs
index 37ae3a51..dc8d4646 100644
--- a/AdvancedSharpAdbClient/Exceptions/ExceptionExtensions.cs
+++ b/AdvancedSharpAdbClient/Exceptions/ExceptionExtensions.cs
@@ -96,7 +96,7 @@ public static void ThrowIfNegative(int value, [CallerArgumentExpression(nameof(v
[StackTraceHidden]
#endif
public static void ThrowIf(
-#if HAS_IndexRange
+#if HAS_INDEXRANGE
[DoesNotReturnIf(true)]
#endif
bool condition, object instance)
diff --git a/AdvancedSharpAdbClient/Exceptions/PackageInstallationException.cs b/AdvancedSharpAdbClient/Exceptions/PackageInstallationException.cs
index 589f41ec..a3315f74 100644
--- a/AdvancedSharpAdbClient/Exceptions/PackageInstallationException.cs
+++ b/AdvancedSharpAdbClient/Exceptions/PackageInstallationException.cs
@@ -4,7 +4,7 @@
using System;
-#if HAS_Serialization
+#if HAS_SERIALIZATION
using System.Runtime.Serialization;
#endif
@@ -13,7 +13,7 @@ namespace AdvancedSharpAdbClient.DeviceCommands
///
/// An exception while installing a package on the device.
///
-#if HAS_Serialization
+#if HAS_SERIALIZATION
[Serializable]
#endif
public class PackageInstallationException : Exception
@@ -42,7 +42,7 @@ public PackageInstallationException(string message, Exception inner) : base(mess
{
}
-#if HAS_Serialization
+#if HAS_SERIALIZATION
///
/// Initializes a new instance of the class.
///
diff --git a/AdvancedSharpAdbClient/Exceptions/PermissionDeniedException.cs b/AdvancedSharpAdbClient/Exceptions/PermissionDeniedException.cs
index 16647da6..0c8da7da 100644
--- a/AdvancedSharpAdbClient/Exceptions/PermissionDeniedException.cs
+++ b/AdvancedSharpAdbClient/Exceptions/PermissionDeniedException.cs
@@ -4,7 +4,7 @@
using System;
-#if HAS_Serialization
+#if HAS_SERIALIZATION
using System.Runtime.Serialization;
#endif
@@ -30,7 +30,7 @@ public PermissionDeniedException(string message) : base(message)
{
}
-#if HAS_Serialization
+#if HAS_SERIALIZATION
///
/// Initializes a new instance of the class.
///
diff --git a/AdvancedSharpAdbClient/Exceptions/ShellCommandUnresponsiveException.cs b/AdvancedSharpAdbClient/Exceptions/ShellCommandUnresponsiveException.cs
index 414dd7da..c01a1a16 100644
--- a/AdvancedSharpAdbClient/Exceptions/ShellCommandUnresponsiveException.cs
+++ b/AdvancedSharpAdbClient/Exceptions/ShellCommandUnresponsiveException.cs
@@ -4,7 +4,7 @@
using System;
-#if HAS_Serialization
+#if HAS_SERIALIZATION
using System.Runtime.Serialization;
#endif
@@ -51,7 +51,7 @@ public ShellCommandUnresponsiveException(string message, Exception inner) : base
{
}
-#if HAS_Serialization
+#if HAS_SERIALIZATION
///
/// Initializes a new instance of the class with serialized
/// data.
diff --git a/AdvancedSharpAdbClient/Exceptions/UnknownOptionException.cs b/AdvancedSharpAdbClient/Exceptions/UnknownOptionException.cs
index d551aadb..4cd04f9b 100644
--- a/AdvancedSharpAdbClient/Exceptions/UnknownOptionException.cs
+++ b/AdvancedSharpAdbClient/Exceptions/UnknownOptionException.cs
@@ -4,7 +4,7 @@
using System;
-#if HAS_Serialization
+#if HAS_SERIALIZATION
using System.Runtime.Serialization;
#endif
@@ -30,7 +30,7 @@ public UnknownOptionException(string message) : base(message)
{
}
-#if HAS_Serialization
+#if HAS_SERIALIZATION
///
/// Initializes a new instance of the class.
///
diff --git a/AdvancedSharpAdbClient/Extensions/CrossPlatformFunc.cs b/AdvancedSharpAdbClient/Extensions/CrossPlatformFunc.cs
index b0782019..ff8788c6 100644
--- a/AdvancedSharpAdbClient/Extensions/CrossPlatformFunc.cs
+++ b/AdvancedSharpAdbClient/Extensions/CrossPlatformFunc.cs
@@ -25,7 +25,7 @@ public static class CrossPlatformFunc
/// The return code of the process.
public static Func, List, int> RunProcess { get; set; } = (string filename, string command, List errorOutput, List standardOutput) =>
{
-#if HAS_Process
+#if HAS_PROCESS
ProcessStartInfo psi = new(filename, command)
{
CreateNoWindow = true,
diff --git a/AdvancedSharpAdbClient/Extensions/TaskToApm.cs b/AdvancedSharpAdbClient/Extensions/TaskToApm.cs
index 0d5558b4..a0b7a9d3 100644
--- a/AdvancedSharpAdbClient/Extensions/TaskToApm.cs
+++ b/AdvancedSharpAdbClient/Extensions/TaskToApm.cs
@@ -1,4 +1,4 @@
-#if !HAS_Process
+#if !HAS_PROCESS
// Licensed to the .NET Foundation under one or more agreements.
// The .NET Foundation licenses this file to you under the MIT license.
diff --git a/AdvancedSharpAdbClient/Extensions/Utilities.cs b/AdvancedSharpAdbClient/Extensions/Utilities.cs
index c2af1d24..4d8fba10 100644
--- a/AdvancedSharpAdbClient/Extensions/Utilities.cs
+++ b/AdvancedSharpAdbClient/Extensions/Utilities.cs
@@ -7,7 +7,7 @@
using System.Threading.Tasks;
using System.Threading;
-#if !HAS_Process
+#if !HAS_PROCESS
using System.Net.Sockets;
#endif
@@ -149,7 +149,7 @@ public static long ToUnixTimeSeconds(this DateTimeOffset dateTimeOffset) =>
(int)dateTimeOffset.ToUnixTimeSeconds();
#endif
-#if !HAS_Process
+#if !HAS_PROCESS
///
/// Begins to asynchronously receive data from a connected .
///
@@ -166,7 +166,7 @@ public static IAsyncResult BeginReceive(this Socket socket, byte[] buffer, int o
TaskToApm.Begin(socket.ReceiveAsync(buffer, offset, size, socketFlags, default), callback, state);
#endif
-#if !HAS_Process
+#if !HAS_PROCESS
///
/// Ends a pending asynchronous read.
///
diff --git a/AdvancedSharpAdbClient/Models/Framebuffer.cs b/AdvancedSharpAdbClient/Models/Framebuffer.cs
index 2b08292f..394f19a1 100644
--- a/AdvancedSharpAdbClient/Models/Framebuffer.cs
+++ b/AdvancedSharpAdbClient/Models/Framebuffer.cs
@@ -13,7 +13,7 @@
using System.Runtime.Versioning;
#endif
-#if HAS_Drawing
+#if HAS_DRAWING
using System.Drawing;
#endif
@@ -104,7 +104,7 @@ public async Task RefreshAsync(CancellationToken cancellationToken = default)
_ = await socket.ReadAsync(Data, (int)Header.Size, cancellationToken).ConfigureAwait(false);
}
-#if HAS_Drawing
+#if HAS_DRAWING
///
/// Converts the framebuffer data to a .
///
diff --git a/AdvancedSharpAdbClient/Models/FramebufferHeader.cs b/AdvancedSharpAdbClient/Models/FramebufferHeader.cs
index fa8744fe..e1b3bf56 100644
--- a/AdvancedSharpAdbClient/Models/FramebufferHeader.cs
+++ b/AdvancedSharpAdbClient/Models/FramebufferHeader.cs
@@ -10,7 +10,7 @@
using System.Runtime.Versioning;
#endif
-#if HAS_Drawing
+#if HAS_DRAWING
using System.Drawing;
using System.Drawing.Imaging;
using System.Runtime.InteropServices;
@@ -140,7 +140,7 @@ public static FramebufferHeader Read(byte[] data)
return header;
}
-#if HAS_Drawing
+#if HAS_DRAWING
///
/// Converts a array containing the raw frame buffer data to a .
///
diff --git a/Directory.Build.props b/Directory.Build.props
index 9e6d87f4..2ad5212e 100644
--- a/Directory.Build.props
+++ b/Directory.Build.props
@@ -2,10 +2,10 @@
.NET client for adb, the Android Debug Bridge (AdvancedSharpAdbClient)
- The Android Open Source Project, Ryan Conrad, Quamotion and improved by yungd1plomat, wherewhere
+ The Android Open Source Project, Ryan Conrad, Quamotion and improved by yungd1plomat and wherewhere
True
https://github.com/quamotion/madb
- AdvancedSharpAdbClient is a .NET library that allows .NET and .NET Core applications to communicate with Android devices. It's a improved version of SharpAdbClient.
+ AdvancedSharpAdbClient is a .NET library that allows .NET, Mono, Unity applications to communicate with Android devices. It's a improved version of SharpAdbClient.
True
True
True
@@ -17,14 +17,14 @@
https://github.com/yungd1plomat/AdvancedSharpAdbClient
True
https://github.com/wherewhere/DotnetEx/releases
- android;adb;SharpAdbClient;AdvancedSharpAdbClient
+ Android;ADB;Communicate;UWP;Xamarin;MAUI;WinUI;Mono;Unity;SharpAdbClient;AdvancedSharpAdbClient
git
AdvancedSharpAdbClient: A .NET client for the Android Debug Bridge (adb)
True
https://github.com/yungd1plomat/AdvancedSharpAdbClient
snupkg
.NET client for adb, Android Debug Bridge (AdvancedSharpAdbClient)
- 2.5.5
+ 2.5.6