Skip to content

Commit 7797553

Browse files
committed
Clarify file size limits and V2 requirements in docs
Updated XML documentation comments to specify that file sizes above 4GB require V2 protocol, and V2 requires Android 11 or above in most cases. Added remarks about 4 GiB cutoff due to 32-bit unsigned integer usage in file statistics. These clarifications affect device, sync service, and model classes, as well as issue templates.
1 parent 75964a3 commit 7797553

10 files changed

Lines changed: 27 additions & 13 deletions

File tree

.github/ISSUE_TEMPLATE/bug_report.yaml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@ name: Bug report
22
description: Create a report to help us improve
33
title: Bug title
44
labels: [bug]
5+
type: Bug
56
body:
67
- type: textarea
78
validations:

.github/ISSUE_TEMPLATE/feature_request.yaml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@ name: Feature request
22
description: Suggest an idea for this project
33
title: Feature title
44
labels: [enhancement]
5+
type: Feature
56
body:
67
- type: textarea
78
validations:

AdvancedSharpAdbClient/DeviceCommands/DeviceExtensions.Async.cs

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -223,7 +223,7 @@ public static Task StopAppAsync(this IAdbClient client, DeviceData device, strin
223223
/// <param name="useV2"><see langword="true"/> to use <see cref="SyncCommand.RCV2"/> and <see cref="SyncCommand.STA2"/>; otherwise, <see langword="false"/> use <see cref="SyncCommand.RECV"/> and <see cref="SyncCommand.STAT"/>.</param>
224224
/// <param name="cancellationToken">A <see cref="CancellationToken"/> that can be used to cancel the task.</param>
225225
/// <returns>A <see cref="Task"/> which represents the asynchronous operation.</returns>
226-
/// <remarks>V2 need Android 8 or above.</remarks>
226+
/// <remarks>File size bigger than 4GB need V2, and V2 need Android 11 or above.</remarks>
227227
public static async Task PullAsync(this IAdbClient client, DeviceData device,
228228
string remotePath, Stream stream,
229229
Action<SyncProgressChangedEventArgs>? callback = null,
@@ -265,6 +265,7 @@ public static async Task PushAsync(this IAdbClient client, DeviceData device,
265265
/// <param name="path">The path to the file.</param>
266266
/// <param name="cancellationToken">A <see cref="CancellationToken"/> that can be used to cancel the task.</param>
267267
/// <returns>A <see cref="Task{FileStatistics}"/> which returns a <see cref="FileStatistics"/> object that contains information about the file.</returns>
268+
/// <remarks>The file size will be cut off at 4 GiB due to the use of a 32-bit unsigned integer.</remarks>
268269
public static async Task<FileStatistics> StatAsync(this IAdbClient client, DeviceData device, string path, CancellationToken cancellationToken = default)
269270
{
270271
using ISyncService service = Factories.SyncServiceFactory(client, device);
@@ -294,6 +295,7 @@ public static async Task<FileStatisticsEx> StatExAsync(this IAdbClient client, D
294295
/// <param name="useV2"><see langword="true"/> to use <see cref="StatAsync(IAdbClient, DeviceData, string, CancellationToken)"/>; otherwise, use <see cref="StatExAsync"/>.</param>
295296
/// <param name="cancellationToken">A <see cref="CancellationToken"/> that can be used to cancel the task.</param>
296297
/// <returns>A <see cref="Task{IFileStatistics}"/> which returns a <see cref="IFileStatistics"/> object that contains information about the file.</returns>
298+
/// <remarks>The file size will be cut off at 4 GiB due to the use of a 32-bit unsigned integer.</remarks>
297299
public static Task<IFileStatistics> StatAsync(this IAdbClient client, DeviceData device, string path, bool useV2, CancellationToken cancellationToken = default) =>
298300
useV2 ? client.StatExAsync(device, path, cancellationToken).ContinueWith(x => x.Result as IFileStatistics) : client.StatAsync(device, path, cancellationToken).ContinueWith(x => x.Result as IFileStatistics);
299301

@@ -305,6 +307,7 @@ public static Task<IFileStatistics> StatAsync(this IAdbClient client, DeviceData
305307
/// <param name="remotePath">The path to the directory on the device.</param>
306308
/// <param name="cancellationToken">A <see cref="CancellationToken"/> that can be used to cancel the task.</param>
307309
/// <returns>A <see cref="Task{List}"/> which returns for each child item of the directory, a <see cref="FileStatistics"/> object with information of the item.</returns>
310+
/// <remarks>The file size will be cut off at 4 GiB due to the use of a 32-bit unsigned integer.</remarks>
308311
public static async Task<List<FileStatistics>> GetDirectoryListingAsync(this IAdbClient client, DeviceData device, string remotePath, CancellationToken cancellationToken = default)
309312
{
310313
using ISyncService service = Factories.SyncServiceFactory(client, device);
@@ -334,6 +337,7 @@ public static async Task<List<FileStatisticsEx>> GetDirectoryListingExAsync(this
334337
/// <param name="useV2"><see langword="true"/> to use <see cref="GetDirectoryListingAsync(IAdbClient, DeviceData, string, CancellationToken)"/>; otherwise, use <see cref="GetDirectoryListingExAsync"/>.</param>
335338
/// <param name="cancellationToken">A <see cref="CancellationToken"/> that can be used to cancel the task.</param>
336339
/// <returns>A <see cref="Task{IEnumerable}"/> which returns for each child item of the directory, a <see cref="IFileStatistics"/> object with information of the item.</returns>
340+
/// <remarks>File size bigger than 4GB need V2, and V2 need Android 11 or above.</remarks>
337341
public static Task<IEnumerable<IFileStatistics>> GetDirectoryListingAsync(this IAdbClient client, DeviceData device, string remotePath, bool useV2, CancellationToken cancellationToken = default) =>
338342
#if NETFRAMEWORK && !NET40_OR_GREATER
339343
useV2 ? client.GetDirectoryListingExAsync(device, remotePath, cancellationToken).ContinueWith(x => x.Result.OfType<IFileStatistics>()) : client.GetDirectoryListingAsync(device, remotePath, cancellationToken).ContinueWith(x => x.Result.OfType<IFileStatistics>());
@@ -350,6 +354,7 @@ public static Task<IEnumerable<IFileStatistics>> GetDirectoryListingAsync(this I
350354
/// <param name="remotePath">The path to the directory on the device.</param>
351355
/// <param name="cancellationToken">A <see cref="CancellationToken"/> that can be used to cancel the task.</param>
352356
/// <returns>An <see cref="IAsyncEnumerable{FileStatistics}"/> which returns for each child item of the directory, a <see cref="FileStatistics"/> object with information of the item.</returns>
357+
/// <remarks>The file size will be cut off at 4 GiB due to the use of a 32-bit unsigned integer.</remarks>
353358
public static async IAsyncEnumerable<FileStatistics> GetDirectoryAsyncListing(this IAdbClient client, DeviceData device, string remotePath, [EnumeratorCancellation] CancellationToken cancellationToken = default)
354359
{
355360
using ISyncService service = Factories.SyncServiceFactory(client, device);
@@ -385,6 +390,7 @@ public static async IAsyncEnumerable<FileStatisticsEx> GetDirectoryAsyncListingE
385390
/// <param name="useV2"><see langword="true"/> to use <see cref="GetDirectoryListingAsync(IAdbClient, DeviceData, string, CancellationToken)"/>; otherwise, use <see cref="GetDirectoryListingExAsync"/>.</param>
386391
/// <param name="cancellationToken">A <see cref="CancellationToken"/> that can be used to cancel the task.</param>
387392
/// <returns>An <see cref="IAsyncEnumerable{IFileStatistics}"/> which returns for each child item of the directory, a <see cref="IFileStatistics"/> object with information of the item.</returns>
393+
/// <remarks>File size bigger than 4GB need V2, and V2 need Android 11 or above.</remarks>
388394
public static IAsyncEnumerable<IFileStatistics> GetDirectoryAsyncListing(this IAdbClient client, DeviceData device, string remotePath, bool useV2, CancellationToken cancellationToken = default) =>
389395
useV2 ? client.GetDirectoryAsyncListingEx(device, remotePath, cancellationToken) : client.GetDirectoryAsyncListing(device, remotePath, cancellationToken);
390396
#endif
@@ -497,7 +503,7 @@ public static Task InstallMultiplePackageAsync(this IAdbClient client, DeviceDat
497503
/// <param name="useV2"><see langword="true"/> to use <see cref="SyncCommand.RCV2"/> and <see cref="SyncCommand.STA2"/>; otherwise, <see langword="false"/> use <see cref="SyncCommand.RECV"/> and <see cref="SyncCommand.STAT"/>.</param>
498504
/// <param name="cancellationToken">A <see cref="CancellationToken"/> that can be used to cancel the task.</param>
499505
/// <returns>A <see cref="Task"/> which represents the asynchronous operation.</returns>
500-
/// <remarks>V2 need Android 8 or above.</remarks>
506+
/// <remarks>File size bigger than 4GB need V2, and V2 need Android 11 or above.</remarks>
501507
public static async Task PullAsync(this IAdbClient client, DeviceData device,
502508
string remotePath, Stream stream,
503509
IProgress<SyncProgressChangedEventArgs>? progress,

AdvancedSharpAdbClient/DeviceCommands/DeviceExtensions.cs

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -183,7 +183,7 @@ public static void StopApp(this IAdbClient client, DeviceData device, string pac
183183
/// <param name="callback">An optional parameter which, when specified, returns progress notifications. The progress is reported as a value between 0 and 100, representing the percentage of the file which has been transferred.</param>
184184
/// <param name="useV2"><see langword="true"/> to use <see cref="SyncCommand.RCV2"/> and <see cref="SyncCommand.STA2"/>; otherwise, <see langword="false"/> use <see cref="SyncCommand.RECV"/> and <see cref="SyncCommand.STAT"/>.</param>
185185
/// <param name="isCancelled">A <see cref="bool"/> that can be used to cancel the task.</param>
186-
/// <remarks>V2 need Android 8 or above.</remarks>
186+
/// <remarks>File size bigger than 4GB need V2, and V2 need Android 11 or above.</remarks>
187187
public static void Pull(this IAdbClient client, DeviceData device,
188188
string remotePath, Stream stream,
189189
Action<SyncProgressChangedEventArgs>? callback = null,
@@ -224,6 +224,7 @@ public static void Push(this IAdbClient client, DeviceData device,
224224
/// <param name="device">The device on which to look for the file.</param>
225225
/// <param name="path">The path to the file.</param>
226226
/// <returns>A <see cref="FileStatistics"/> object that represents the file.</returns>
227+
/// <remarks>The file size will be cut off at 4 GiB due to the use of a 32-bit unsigned integer.</remarks>
227228
public static FileStatistics Stat(this IAdbClient client, DeviceData device, string path)
228229
{
229230
using ISyncService service = Factories.SyncServiceFactory(client, device);
@@ -252,7 +253,7 @@ public static FileStatisticsEx StatEx(this IAdbClient client, DeviceData device,
252253
/// <param name="path">The path to the file.</param>
253254
/// <param name="useV2"><see langword="true"/> to use <see cref="Stat(IAdbClient, DeviceData, string)"/>; otherwise, use <see cref="StatEx"/>.</param>
254255
/// <returns>A <see cref="IFileStatistics"/> object that represents the file.</returns>
255-
/// <remarks>V2 need Android 8 or above.</remarks>
256+
/// <remarks>File size bigger than 4GB need V2, and V2 need Android 8 or above.</remarks>
256257
public static IFileStatistics Stat(this IAdbClient client, DeviceData device, string path, bool useV2) =>
257258
useV2 ? client.StatEx(device, path) : client.Stat(device, path);
258259

@@ -403,7 +404,7 @@ public static void InstallMultiplePackage(this IAdbClient client, DeviceData dev
403404
/// <param name="progress">An optional parameter which, when specified, returns progress notifications. The progress is reported as a value between 0 and 100, representing the percentage of the file which has been transferred.</param>
404405
/// <param name="useV2"><see langword="true"/> to use <see cref="SyncCommand.RCV2"/> and <see cref="SyncCommand.STA2"/>; otherwise, <see langword="false"/> use <see cref="SyncCommand.RECV"/> and <see cref="SyncCommand.STAT"/>.</param>
405406
/// <param name="isCancelled">A <see cref="bool"/> that can be used to cancel the task.</param>
406-
/// <remarks>V2 need Android 8 or above.</remarks>
407+
/// <remarks>File size bigger than 4GB need V2, and V2 need Android 11 or above.</remarks>
407408
public static void Pull(this IAdbClient client, DeviceData device,
408409
string remotePath, Stream stream,
409410
IProgress<SyncProgressChangedEventArgs>? progress = null,

AdvancedSharpAdbClient/Extensions/SyncServiceExtensions.Async.cs

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ public static partial class SyncServiceExtensions
2121
/// <param name="useV2"><see langword="true"/> to use <see cref="ISyncService.StatAsync"/>; otherwise, use <see cref="ISyncService.StatExAsync"/>.</param>
2222
/// <param name="cancellationToken">A <see cref="CancellationToken"/> that can be used to cancel the task.</param>
2323
/// <returns>A <see cref="Task{IFileStatistics}"/> which returns a <see cref="IFileStatistics"/> object that contains information about the file.</returns>
24-
/// <remarks>V2 need Android 8 or above.</remarks>
24+
/// <remarks>File size bigger than 4GB need V2, and V2 need Android 8 or above.</remarks>
2525
public static Task<IFileStatistics> StatAsync(this ISyncService service, string remotePath, bool useV2 = false, CancellationToken cancellationToken = default) =>
2626
useV2 ? service.StatExAsync(remotePath, cancellationToken).ContinueWith(x => x.Result as IFileStatistics) : service.StatAsync(remotePath, cancellationToken).ContinueWith(x => x.Result as IFileStatistics);
2727

@@ -33,6 +33,7 @@ public static Task<IFileStatistics> StatAsync(this ISyncService service, string
3333
/// <param name="useV2"><see langword="true"/> to use <see cref="ISyncService.GetDirectoryListingAsync"/>; otherwise, use <see cref="ISyncService.GetDirectoryListingExAsync"/>.</param>
3434
/// <param name="cancellationToken">A <see cref="CancellationToken"/> that can be used to cancel the task.</param>
3535
/// <returns>A <see cref="Task{IEnumerable}"/> which returns for each child item of the directory, a <see cref="IFileStatistics"/> object with information of the item.</returns>
36+
/// <remarks>File size bigger than 4GB need V2, and V2 need Android 11 or above.</remarks>
3637
public static Task<IEnumerable<IFileStatistics>> GetDirectoryListingAsync(this ISyncService service, string remotePath, bool useV2 = false, CancellationToken cancellationToken = default) =>
3738
#if NETFRAMEWORK && !NET40_OR_GREATER
3839
useV2 ? service.GetDirectoryListingExAsync(remotePath, cancellationToken).ContinueWith(x => x.Result.OfType<IFileStatistics>()) : service.GetDirectoryListingAsync(remotePath, cancellationToken).ContinueWith(x => x.Result.OfType<IFileStatistics>());
@@ -49,6 +50,7 @@ public static Task<IEnumerable<IFileStatistics>> GetDirectoryListingAsync(this I
4950
/// <param name="useV2"><see langword="true"/> to use <see cref="ISyncService.GetDirectoryListingAsync"/>; otherwise, use <see cref="ISyncService.GetDirectoryListingExAsync"/>.</param>
5051
/// <param name="cancellationToken">A <see cref="CancellationToken"/> that can be used to cancel the task.</param>
5152
/// <returns>An <see cref="IAsyncEnumerable{IFileStatistics}"/> which returns for each child item of the directory, a <see cref="FileStatistics"/> object with information of the item.</returns>
53+
/// <remarks>File size bigger than 4GB need V2, and V2 need Android 11 or above.</remarks>
5254
public static IAsyncEnumerable<IFileStatistics> GetDirectoryAsyncListing(this ISyncService service, string remotePath, bool useV2 = false, CancellationToken cancellationToken = default) =>
5355
useV2 ? service.GetDirectoryAsyncListingEx(remotePath, cancellationToken) : service.GetDirectoryAsyncListing(remotePath, cancellationToken);
5456
#endif
@@ -79,7 +81,7 @@ public static Task PushAsync(this ISyncService service, Stream stream, string re
7981
/// <param name="useV2"><see langword="true"/> to use <see cref="SyncCommand.RCV2"/> and <see cref="SyncCommand.STA2"/>; otherwise, <see langword="false"/> use <see cref="SyncCommand.RECV"/> and <see cref="SyncCommand.STAT"/>.</param>
8082
/// <param name="cancellationToken">A <see cref="CancellationToken"/> that can be used to cancel the task.</param>
8183
/// <returns>A <see cref="Task"/> which represents the asynchronous operation.</returns>
82-
/// <remarks>V2 need Android 8 or above.</remarks>
84+
/// <remarks>File size bigger than 4GB need V2, and V2 need Android 11 or above.</remarks>
8385
public static Task PullAsync(this ISyncService service, string remotePath, Stream stream, IProgress<SyncProgressChangedEventArgs>? progress = null, bool useV2 = false, CancellationToken cancellationToken = default) =>
8486
service.PullAsync(remotePath, stream, progress.AsAction(), useV2, cancellationToken);
8587

@@ -109,7 +111,7 @@ public static Task PushAsync(this ISyncService.IWinRT service, IInputStream stre
109111
/// <param name="useV2"><see langword="true"/> to use <see cref="SyncCommand.RCV2"/> and <see cref="SyncCommand.STA2"/>; otherwise, <see langword="false"/> use <see cref="SyncCommand.RECV"/> and <see cref="SyncCommand.STAT"/>.</param>
110112
/// <param name="cancellationToken">A <see cref="CancellationToken"/> that can be used to cancel the task.</param>
111113
/// <returns>A <see cref="Task"/> which represents the asynchronous operation.</returns>
112-
/// <remarks>V2 need Android 8 or above.</remarks>
114+
/// <remarks>File size bigger than 4GB need V2, and V2 need Android 11 or above.</remarks>
113115
public static Task PullAsync(this ISyncService.IWinRT service, string remotePath, IOutputStream stream, IProgress<SyncProgressChangedEventArgs>? progress = null, bool useV2 = false, CancellationToken cancellationToken = default) =>
114116
service.PullAsync(remotePath, stream, progress.AsAction(), useV2, cancellationToken);
115117
#endif

AdvancedSharpAdbClient/Extensions/SyncServiceExtensions.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ public static partial class SyncServiceExtensions
2121
/// <param name="remotePath">The path of the file on the device.</param>
2222
/// <param name="useV2"><see langword="true"/> to use <see cref="ISyncService.Stat"/>; otherwise, use <see cref="ISyncService.StatEx"/>.</param>
2323
/// <returns>A <see cref="IFileStatistics"/> object that contains information about the file.</returns>
24-
/// <remarks>V2 need Android 8 or above.</remarks>
24+
/// <remarks>File size bigger than 4GB need V2, and V2 need Android 8 or above.</remarks>
2525
public static IFileStatistics Stat(this ISyncService service, string remotePath, bool useV2 = false) =>
2626
useV2 ? service.StatEx(remotePath) : service.Stat(remotePath);
2727

@@ -65,7 +65,7 @@ public static void Push(this ISyncService service, Stream stream, string remoteP
6565
/// <param name="progress">An optional parameter which, when specified, returns progress notifications. The progress is reported as <see cref="SyncProgressChangedEventArgs"/>, representing the state of the file which has been transferred.</param>
6666
/// <param name="useV2"><see langword="true"/> to use <see cref="SyncCommand.RCV2"/> and <see cref="SyncCommand.STA2"/>; otherwise, <see langword="false"/> use <see cref="SyncCommand.RECV"/> and <see cref="SyncCommand.STAT"/>.</param>
6767
/// <param name="isCancelled">A <see cref="bool"/> that can be used to cancel the task.</param>
68-
/// <remarks>V2 need Android 8 or above.</remarks>
68+
/// <remarks>File size bigger than 4GB need V2, and V2 need Android 11 or above.</remarks>
6969
public static void Pull(this ISyncService service, string remotePath, Stream stream, IProgress<SyncProgressChangedEventArgs>? progress = null, bool useV2 = false, in bool isCancelled = false) =>
7070
service.Pull(remotePath, stream, progress.AsAction(), useV2, isCancelled);
7171

0 commit comments

Comments
 (0)