Merge pull request 'fix secure_mkdirs' (#3) from unstable into master
Reviewed-on: #3
This commit is contained in:
commit
520bcb7965
2 changed files with 13 additions and 0 deletions
|
|
@ -2,6 +2,7 @@ using System.Reflection;
|
|||
using AdvancedSharpAdbClient;
|
||||
using AdvancedSharpAdbClient.DeviceCommands;
|
||||
using AdvancedSharpAdbClient.Models;
|
||||
using AdvancedSharpAdbClient.Receivers;
|
||||
using MetaforceInstaller.Core.Intefaces;
|
||||
using MetaforceInstaller.Core.Models;
|
||||
using Microsoft.Extensions.Logging;
|
||||
|
|
@ -154,6 +155,17 @@ public class AdbService : IAdbService
|
|||
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(() =>
|
||||
{
|
||||
using var fileStream = File.OpenRead(localPath);
|
||||
|
|
|
|||
|
|
@ -8,6 +8,7 @@
|
|||
<BuiltInComInteropSupport>true</BuiltInComInteropSupport>
|
||||
<ApplicationManifest>app.manifest</ApplicationManifest>
|
||||
<AvaloniaUseCompiledBindingsByDefault>true</AvaloniaUseCompiledBindingsByDefault>
|
||||
<FileVersion>1.2.1</FileVersion>
|
||||
</PropertyGroup>
|
||||
|
||||
<ItemGroup>
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue