fix secure_mkdirs #3
2 changed files with 13 additions and 0 deletions
|
|
@ -2,6 +2,7 @@ using System.Reflection;
|
||||||
using AdvancedSharpAdbClient;
|
using AdvancedSharpAdbClient;
|
||||||
using AdvancedSharpAdbClient.DeviceCommands;
|
using AdvancedSharpAdbClient.DeviceCommands;
|
||||||
using AdvancedSharpAdbClient.Models;
|
using AdvancedSharpAdbClient.Models;
|
||||||
|
using AdvancedSharpAdbClient.Receivers;
|
||||||
using MetaforceInstaller.Core.Intefaces;
|
using MetaforceInstaller.Core.Intefaces;
|
||||||
using MetaforceInstaller.Core.Models;
|
using MetaforceInstaller.Core.Models;
|
||||||
using Microsoft.Extensions.Logging;
|
using Microsoft.Extensions.Logging;
|
||||||
|
|
@ -154,6 +155,17 @@ public class AdbService : IAdbService
|
||||||
TotalBytes = fileInfo.Length
|
TotalBytes = fileInfo.Length
|
||||||
});
|
});
|
||||||
|
|
||||||
|
var remoteDir = Path.GetDirectoryName(remotePath)?.Replace('\\', '/');
|
||||||
|
if (!string.IsNullOrEmpty(remoteDir))
|
||||||
|
{
|
||||||
|
var reciever = new ConsoleOutputReceiver();
|
||||||
|
await Task.Run(
|
||||||
|
() => { _adbClient.ExecuteRemoteCommand($"mkdir -p \"{remoteDir}\"", _deviceData, reciever); },
|
||||||
|
cancellationToken);
|
||||||
|
}
|
||||||
|
|
||||||
|
_logger.LogInformation($"Ensured remote directory: {remoteDir}");
|
||||||
|
|
||||||
await Task.Run(() =>
|
await Task.Run(() =>
|
||||||
{
|
{
|
||||||
using var fileStream = File.OpenRead(localPath);
|
using var fileStream = File.OpenRead(localPath);
|
||||||
|
|
|
||||||
|
|
@ -8,6 +8,7 @@
|
||||||
<BuiltInComInteropSupport>true</BuiltInComInteropSupport>
|
<BuiltInComInteropSupport>true</BuiltInComInteropSupport>
|
||||||
<ApplicationManifest>app.manifest</ApplicationManifest>
|
<ApplicationManifest>app.manifest</ApplicationManifest>
|
||||||
<AvaloniaUseCompiledBindingsByDefault>true</AvaloniaUseCompiledBindingsByDefault>
|
<AvaloniaUseCompiledBindingsByDefault>true</AvaloniaUseCompiledBindingsByDefault>
|
||||||
|
<FileVersion>1.2.1</FileVersion>
|
||||||
</PropertyGroup>
|
</PropertyGroup>
|
||||||
|
|
||||||
<ItemGroup>
|
<ItemGroup>
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue