Skip to content

Commit

Permalink
Release v2.5.6
Browse files Browse the repository at this point in the history
  • Loading branch information
wherewhere committed May 27, 2023
1 parent fb20985 commit 5def8c5
Show file tree
Hide file tree
Showing 22 changed files with 44 additions and 43 deletions.
1 change: 1 addition & 0 deletions .github/ISSUE_TEMPLATE/bug_report.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down
2 changes: 1 addition & 1 deletion AdvancedSharpAdbClient/AdbCommandLineClient.cs
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down
4 changes: 2 additions & 2 deletions AdvancedSharpAdbClient/AdvancedSharpAdbClient.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -97,14 +97,14 @@
or '$(TargetFramework)' == 'net8.0'
or '$(TargetFramework)' == 'netcoreapp3.1'
or '$(TargetFramework)' == 'netstandard2.1'">
<DefineConstants>$(DefineConstants);HAS_IndexRange</DefineConstants>
<DefineConstants>$(DefineConstants);HAS_INDEXRANGE</DefineConstants>
</PropertyGroup>

<PropertyGroup Condition="'$(TargetFramework)' != 'netcore50'
and '$(TargetFramework)' != 'netcoreapp1.0'
and '$(TargetFramework)' != 'netcoreapp1.1'
and '$(TargetFramework)' != 'netstandard1.3'">
<DefineConstants>$(DefineConstants);HAS_Process;HAS_Drawing;HAS_Serialization</DefineConstants>
<DefineConstants>$(DefineConstants);HAS_PROCESS;HAS_DRAWING;HAS_SERIALIZATION</DefineConstants>
</PropertyGroup>

</Project>
6 changes: 3 additions & 3 deletions AdvancedSharpAdbClient/DeviceCommands/LinuxPath.cs
Original file line number Diff line number Diff line change
Expand Up @@ -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];
Expand All @@ -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];
Expand Down Expand Up @@ -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);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand All @@ -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]);
Expand All @@ -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));
Expand All @@ -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)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ protected override void ProcessNewLines(IEnumerable<string> lines)
// package:mwc2015.be

// Remove the "package:" prefix
#if HAS_IndexRange
#if HAS_INDEXRANGE
string package = line[8..];
#else
string package = line.Substring(8);
Expand All @@ -67,7 +67,7 @@ protected override void ProcessNewLines(IEnumerable<string> lines)
}
else
{
#if HAS_IndexRange
#if HAS_INDEXRANGE
string path = package[..separator];
string name = package[(separator + 1)..];
#else
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down
2 changes: 1 addition & 1 deletion AdvancedSharpAdbClient/DeviceMonitor.cs
Original file line number Diff line number Diff line change
Expand Up @@ -158,7 +158,7 @@ public void Dispose()
monitorTaskCancellationTokenSource.Cancel();
monitorTask.Wait();

#if HAS_Process
#if HAS_PROCESS
monitorTask.Dispose();
#endif
monitorTask = null;
Expand Down
4 changes: 2 additions & 2 deletions AdvancedSharpAdbClient/Exceptions/AdbException.cs
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
using System;
using System.Net.Sockets;

#if HAS_Serialization
#if HAS_SERIALIZATION
using System.Runtime.Serialization;
#endif

Expand Down Expand Up @@ -49,7 +49,7 @@ public AdbException(string message, AdbResponse response) : base(message)
Response = response;
}

#if HAS_Serialization
#if HAS_SERIALIZATION
/// <summary>
/// Initializes a new instance of the <see cref="AdbException"/> class.
/// </summary>
Expand Down
4 changes: 2 additions & 2 deletions AdvancedSharpAdbClient/Exceptions/CommandAbortingException.cs
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@

using System;

#if HAS_Serialization
#if HAS_SERIALIZATION
using System.Runtime.Serialization;
#endif

Expand All @@ -30,7 +30,7 @@ public CommandAbortingException(string message) : base(message)
{
}

#if HAS_Serialization
#if HAS_SERIALIZATION
/// <summary>
/// Initializes a new instance of the <see cref="CommandAbortingException"/> class.
/// </summary>
Expand Down
4 changes: 2 additions & 2 deletions AdvancedSharpAdbClient/Exceptions/DeviceNotFoundException.cs
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@

using System;

#if HAS_Serialization
#if HAS_SERIALIZATION
using System.Runtime.Serialization;
#endif

Expand Down Expand Up @@ -39,7 +39,7 @@ public DeviceNotFoundException(string message, Exception innerException) : base(
{
}

#if HAS_Serialization
#if HAS_SERIALIZATION
/// <summary>
/// Initializes a new instance of the <see cref="DeviceNotFoundException"/> class.
/// </summary>
Expand Down
2 changes: 1 addition & 1 deletion AdvancedSharpAdbClient/Exceptions/ExceptionExtensions.cs
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@

using System;

#if HAS_Serialization
#if HAS_SERIALIZATION
using System.Runtime.Serialization;
#endif

Expand All @@ -13,7 +13,7 @@ namespace AdvancedSharpAdbClient.DeviceCommands
/// <summary>
/// An exception while installing a package on the device.
/// </summary>
#if HAS_Serialization
#if HAS_SERIALIZATION
[Serializable]
#endif
public class PackageInstallationException : Exception
Expand Down Expand Up @@ -42,7 +42,7 @@ public PackageInstallationException(string message, Exception inner) : base(mess
{
}

#if HAS_Serialization
#if HAS_SERIALIZATION
/// <summary>
/// Initializes a new instance of the <see cref="PackageInstallationException"/> class.
/// </summary>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@

using System;

#if HAS_Serialization
#if HAS_SERIALIZATION
using System.Runtime.Serialization;
#endif

Expand All @@ -30,7 +30,7 @@ public PermissionDeniedException(string message) : base(message)
{
}

#if HAS_Serialization
#if HAS_SERIALIZATION
/// <summary>
/// Initializes a new instance of the <see cref="PermissionDeniedException"/> class.
/// </summary>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@

using System;

#if HAS_Serialization
#if HAS_SERIALIZATION
using System.Runtime.Serialization;
#endif

Expand Down Expand Up @@ -51,7 +51,7 @@ public ShellCommandUnresponsiveException(string message, Exception inner) : base
{
}

#if HAS_Serialization
#if HAS_SERIALIZATION
/// <summary>
/// Initializes a new instance of the <see cref="ShellCommandUnresponsiveException"/> class with serialized
/// data.
Expand Down
4 changes: 2 additions & 2 deletions AdvancedSharpAdbClient/Exceptions/UnknownOptionException.cs
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@

using System;

#if HAS_Serialization
#if HAS_SERIALIZATION
using System.Runtime.Serialization;
#endif

Expand All @@ -30,7 +30,7 @@ public UnknownOptionException(string message) : base(message)
{
}

#if HAS_Serialization
#if HAS_SERIALIZATION
/// <summary>
/// Initializes a new instance of the <see cref="UnknownOptionException"/> class.
/// </summary>
Expand Down
2 changes: 1 addition & 1 deletion AdvancedSharpAdbClient/Extensions/CrossPlatformFunc.cs
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ public static class CrossPlatformFunc
/// <returns>The return code of the process.</returns>
public static Func<string, string, List<string>, List<string>, int> RunProcess { get; set; } = (string filename, string command, List<string> errorOutput, List<string> standardOutput) =>
{
#if HAS_Process
#if HAS_PROCESS
ProcessStartInfo psi = new(filename, command)
{
CreateNoWindow = true,
Expand Down
2 changes: 1 addition & 1 deletion AdvancedSharpAdbClient/Extensions/TaskToApm.cs
Original file line number Diff line number Diff line change
@@ -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.

Expand Down
6 changes: 3 additions & 3 deletions AdvancedSharpAdbClient/Extensions/Utilities.cs
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
using System.Threading.Tasks;
using System.Threading;

#if !HAS_Process
#if !HAS_PROCESS
using System.Net.Sockets;
#endif

Expand Down Expand Up @@ -149,7 +149,7 @@ public static long ToUnixTimeSeconds(this DateTimeOffset dateTimeOffset) =>
(int)dateTimeOffset.ToUnixTimeSeconds();
#endif

#if !HAS_Process
#if !HAS_PROCESS
/// <summary>
/// Begins to asynchronously receive data from a connected <see cref="Socket"/>.
/// </summary>
Expand All @@ -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
/// <summary>
/// Ends a pending asynchronous read.
/// </summary>
Expand Down
4 changes: 2 additions & 2 deletions AdvancedSharpAdbClient/Models/Framebuffer.cs
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
using System.Runtime.Versioning;
#endif

#if HAS_Drawing
#if HAS_DRAWING
using System.Drawing;
#endif

Expand Down Expand Up @@ -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
/// <summary>
/// Converts the framebuffer data to a <see cref="Image"/>.
/// </summary>
Expand Down
4 changes: 2 additions & 2 deletions AdvancedSharpAdbClient/Models/FramebufferHeader.cs
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down Expand Up @@ -140,7 +140,7 @@ public static FramebufferHeader Read(byte[] data)
return header;
}

#if HAS_Drawing
#if HAS_DRAWING
/// <summary>
/// Converts a <see cref="byte"/> array containing the raw frame buffer data to a <see cref="Image"/>.
/// </summary>
Expand Down
8 changes: 4 additions & 4 deletions Directory.Build.props
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,10 @@

<PropertyGroup>
<AssemblyTitle>.NET client for adb, the Android Debug Bridge (AdvancedSharpAdbClient)</AssemblyTitle>
<Authors>The Android Open Source Project, Ryan Conrad, Quamotion and improved by yungd1plomat, wherewhere</Authors>
<Authors>The Android Open Source Project, Ryan Conrad, Quamotion and improved by yungd1plomat and wherewhere</Authors>
<ContinuousIntegrationBuild>True</ContinuousIntegrationBuild>
<Copyright>https://github.com/quamotion/madb</Copyright>
<Description>AdvancedSharpAdbClient is a .NET library that allows .NET and .NET Core applications to communicate with Android devices. It's a improved version of SharpAdbClient.</Description>
<Description>AdvancedSharpAdbClient is a .NET library that allows .NET, Mono, Unity applications to communicate with Android devices. It's a improved version of SharpAdbClient.</Description>
<Deterministic>True</Deterministic>
<EmbedUntrackedSources>True</EmbedUntrackedSources>
<GenerateDocumentationFile>True</GenerateDocumentationFile>
Expand All @@ -17,14 +17,14 @@
<PackageProjectUrl>https://github.com/yungd1plomat/AdvancedSharpAdbClient</PackageProjectUrl>
<PackageRequireLicenseAcceptance>True</PackageRequireLicenseAcceptance>
<PackageReleaseNotes>https://github.com/wherewhere/DotnetEx/releases</PackageReleaseNotes>
<PackageTags>android;adb;SharpAdbClient;AdvancedSharpAdbClient</PackageTags>
<PackageTags>Android;ADB;Communicate;UWP;Xamarin;MAUI;WinUI;Mono;Unity;SharpAdbClient;AdvancedSharpAdbClient</PackageTags>
<RepositoryType>git</RepositoryType>
<Product>AdvancedSharpAdbClient: A .NET client for the Android Debug Bridge (adb)</Product>
<PublishRepositoryUrl>True</PublishRepositoryUrl>
<RepositoryUrl>https://github.com/yungd1plomat/AdvancedSharpAdbClient</RepositoryUrl>
<SymbolPackageFormat>snupkg</SymbolPackageFormat>
<Title>.NET client for adb, Android Debug Bridge (AdvancedSharpAdbClient)</Title>
<VersionPrefix>2.5.5</VersionPrefix>
<VersionPrefix>2.5.6</VersionPrefix>
</PropertyGroup>

<PropertyGroup>
Expand Down

0 comments on commit 5def8c5

Please sign in to comment.