Skip to content

Commit

Permalink
Upgrade to Ver.8.4.6
Browse files Browse the repository at this point in the history
  • Loading branch information
zhuxb711 committed Jul 11, 2024
1 parent 7833cd3 commit 65c0af8
Show file tree
Hide file tree
Showing 28 changed files with 87 additions and 91 deletions.
16 changes: 8 additions & 8 deletions AuxiliaryTrustProcess/AuxiliaryTrustProcess.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -42,24 +42,24 @@
<PackageReference Include="UsbEject.NetCore" Version="1.0.4" />
<PackageReference Include="UTF.Unknown" Version="2.5.1" />
<PackageReference Include="Vanara.PInvoke.CfgMgr32">
<Version>4.0.1</Version>
<Version>4.0.2</Version>
</PackageReference>
<PackageReference Include="Vanara.PInvoke.Msi">
<Version>4.0.1</Version>
<Version>4.0.2</Version>
</PackageReference>
<PackageReference Include="Vanara.PInvoke.NetApi32" Version="4.0.1" />
<PackageReference Include="Vanara.PInvoke.NetApi32" Version="4.0.2" />
<PackageReference Include="Vanara.PInvoke.NtDll">
<Version>4.0.1</Version>
<Version>4.0.2</Version>
</PackageReference>
<PackageReference Include="Vanara.PInvoke.RstrtMgr">
<Version>4.0.1</Version>
<Version>4.0.2</Version>
</PackageReference>
<PackageReference Include="Vanara.PInvoke.ShlwApi" Version="4.0.1" />
<PackageReference Include="Vanara.PInvoke.ShlwApi" Version="4.0.2" />
<PackageReference Include="Vanara.PInvoke.UserEnv">
<Version>4.0.1</Version>
<Version>4.0.2</Version>
</PackageReference>
<PackageReference Include="Vanara.Windows.Shell">
<Version>4.0.1</Version>
<Version>4.0.2</Version>
</PackageReference>
</ItemGroup>
<ItemGroup>
Expand Down
46 changes: 13 additions & 33 deletions AuxiliaryTrustProcess/Program.cs
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,6 @@
using System.IO;
using System.IO.Pipes;
using System.Linq;
using System.Net;
using System.Net.Http;
using System.Net.NetworkInformation;
using System.Runtime.InteropServices;
Expand Down Expand Up @@ -851,7 +850,7 @@ private static IDictionary<string, string> HandleCommand(IDictionary<string, str
{
case AuxiliaryTrustProcessCommandType.RetrieveAADTokenFromBackend:
{
RetrieveAADTokenContentResponseDto ResponseContentDto = BackendUtil.SendAndGetResponseAsync<RetrieveAADTokenContentResponseDto>(new Uri("https://xz-home.asuscomm.cn:61550/validation/retrieveAADToken"), HttpMethod.Get, CancelToken: Cancellation.Token).Result;
RetrieveAADTokenContentResponseDto ResponseContentDto = BackendUtil.SendAndGetResponseAsync<RetrieveAADTokenContentResponseDto>(new Uri("https://xz-home.asuscomm.cn:61550/api/v1/validation/retrieveAADToken"), HttpMethod.Get, CancelToken: Cancellation.Token).Result;

if (ResponseContentDto.ExpiresOn > DateTimeOffset.Now)
{
Expand All @@ -866,53 +865,34 @@ private static IDictionary<string, string> HandleCommand(IDictionary<string, str
}
case AuxiliaryTrustProcessCommandType.RedeemCodeFromBackend:
{
Value.Add("Success", JsonSerializer.Serialize(BackendUtil.SendAndGetResponseAsync<RedeemCodeContentResponseDto>(new Uri($"https://xz-home.asuscomm.cn:61550/validation/redeemCode?customerCollectionId={Uri.EscapeDataString(CommandValue["CustomerCollectionId"])}"), HttpMethod.Get, CancelToken: Cancellation.Token).Result, JsonSourceGenerationContext.Default.RedeemCodeContentResponseDto));
Value.Add("Success", JsonSerializer.Serialize(BackendUtil.SendAndGetResponseAsync<RedeemCodeContentResponseDto>(new Uri($"https://xz-home.asuscomm.cn:61550/api/v1/validation/redeemCode?customerCollectionId={Uri.EscapeDataString(CommandValue["CustomerCollectionId"])}"), HttpMethod.Get, CancelToken: Cancellation.Token).Result, JsonSourceGenerationContext.Default.RedeemCodeContentResponseDto));
break;
}
case AuxiliaryTrustProcessCommandType.GetAvailableNetworkPort:
{
int Retry = 0;
int RandomPort = 0;
IPGlobalProperties IPProperties = IPGlobalProperties.GetIPGlobalProperties();

IPEndPoint[] Listener = IPProperties.GetActiveTcpListeners();
TcpConnectionInformation[] Connection = IPProperties.GetActiveTcpConnections();

HashSet<int> TriedPorts = new HashSet<int>();
Random Rand = new Random(Guid.NewGuid().GetHashCode());

while (Retry < 200)
for (int Retry = 0; Retry < 100; Retry++)
{
while (true)
int RandomPort = Rand.Next(60000, 65535);

if (TriedPorts.Add(RandomPort))
{
RandomPort = Rand.Next(1000, 30000);
IPGlobalProperties IPProperties = IPGlobalProperties.GetIPGlobalProperties();

if (!TriedPorts.Contains(RandomPort))
if (!IPProperties.GetActiveTcpConnections()
.Select((Connection) => Connection.LocalEndPoint.Port)
.Concat(IPProperties.GetActiveTcpListeners().Select((EndPoint) => EndPoint.Port))
.Contains(RandomPort))
{
TriedPorts.Add(RandomPort);
Value.Add("Success", Convert.ToString(RandomPort));
break;
}
}


if (Connection.Select((Connection) => Connection.LocalEndPoint.Port)
.Concat(Listener.Select((EndPoint) => EndPoint.Port))
.Distinct()
.All((CurrentPort) => CurrentPort != RandomPort))
{
break;
}
else
{
Retry++;
}
}

if (Retry < 200)
{
Value.Add("Success", Convert.ToString(RandomPort));
}
else
if (!Value.ContainsKey("Success"))
{
Value.Add("Error", "Could not get the available port after max retry times");
}
Expand Down
8 changes: 4 additions & 4 deletions MonitorTrustProcess/MonitorTrustProcess.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -21,10 +21,10 @@
<RuntimeIdentifier>win-arm64</RuntimeIdentifier>
</PropertyGroup>
<ItemGroup>
<PackageReference Include="Vanara.PInvoke.Kernel32" Version="4.0.1" />
<PackageReference Include="Vanara.PInvoke.UserEnv" Version="4.0.1" />
<PackageReference Include="Vanara.PInvoke.User32" Version="4.0.1" />
<PackageReference Include="Vanara.PInvoke.Ole" Version="4.0.1" />
<PackageReference Include="Vanara.PInvoke.Kernel32" Version="4.0.2" />
<PackageReference Include="Vanara.PInvoke.UserEnv" Version="4.0.2" />
<PackageReference Include="Vanara.PInvoke.User32" Version="4.0.2" />
<PackageReference Include="Vanara.PInvoke.Ole" Version="4.0.2" />
</ItemGroup>
<ItemGroup>
<ProjectReference Include="..\SharedLibrary\SharedLibrary.csproj" />
Expand Down
2 changes: 1 addition & 1 deletion Package/Package.appxmanifest
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@
<Identity
Name="36186RuoFan.USB"
Publisher="CN=4FF1CB23-04BD-4F9C-A86A-B4A43196FE02"
Version="8.4.5.0" />
Version="8.4.6.0" />

<Properties>
<DisplayName>ms-resource:AppDisplayName</DisplayName>
Expand Down
6 changes: 2 additions & 4 deletions RX_Explorer/Assets/UpdateLog-Chinese_S.txt
Original file line number Diff line number Diff line change
@@ -1,11 +1,9 @@
### 版本8.4.5更新
### 版本8.4.6更新

#### ⚠警告: Uwp版已弃用,RX文件管理器已迁移至Windows App Sdk框架

>##### Windows App Sdk是Uwp的替代框架,新版本已于2023年5月1日发布([点击此处下载](ms-windows-store://pdp/?productid=9PDN2Q3DCQS3)),已购买Uwp版本的用户可以前往 "设置-版本" 中获取兑换码

##### 其他更新

>##### 更新了部分第三方组件

>##### 优化了获取WAS版激活码的逻辑
>##### 更新了后端API地址,启用后端API版本控制
6 changes: 2 additions & 4 deletions RX_Explorer/Assets/UpdateLog-Chinese_T.txt
Original file line number Diff line number Diff line change
@@ -1,11 +1,9 @@
### 版本8.4.5更新
### 版本8.4.6更新

#### ⚠注意:Uwp 已棄用,RX-Explorer 已遷移至 Windows App Sdk

>##### Windows App Sdk 是 Uwp 的替代框架。 新版本已於2023年5月1日發布([點此下載](ms-windows-store://pdp/?productid=9PDN2Q3DCQS3)),已購買Uwp的用戶可前往“設置-版本”獲取激活碼

##### 次要更新

>##### 更新了一些第三方元件

>##### 優化獲取 RX-Explorer (WAS) 啟動碼的邏輯
>##### 更新後端 API 位址,啟用後端 API 版本控制
6 changes: 2 additions & 4 deletions RX_Explorer/Assets/UpdateLog-English.txt
Original file line number Diff line number Diff line change
@@ -1,11 +1,9 @@
### What's new in Ver.8.4.5
### What's new in Ver.8.4.6

#### ⚠Attention: Uwp is deprecated, RX-Explorer has been migrated to Windows App Sdk

>##### Windows App Sdk is an alternative framework for Uwp. The new version was released on 1st May, 2023. ([Click here to download](ms-windows-store://pdp/?productid=9PDN2Q3DCQS3)), users who have purchased the Uwp one can go to "Settings - Version" to get the activation code

##### Minor updates

>##### Updated some third-party components

>##### Optimized the logic of getting the activation code for RX-Explorer (WAS)
>##### Updated backend API address, enabled backend API version control
6 changes: 2 additions & 4 deletions RX_Explorer/Assets/UpdateLog-French.txt
Original file line number Diff line number Diff line change
@@ -1,11 +1,9 @@
### Quoi de neuf dans la version 8.4.5
### Quoi de neuf dans la version 8.4.6

##### ⚠Attention: Uwp est obsolète, RX-Explorer a été migré vers Windows App Sdk

>#### Windows App Sdk est un framework alternatif pour Uwp. La nouvelle version a été publiée le 1er mai 2023. ([Cliquez ici pour télécharger](ms-windows-store://pdp/?productid=9PDN2Q3DCQS3)), les utilisateurs qui ont acheté la version Uwp peuvent aller dans « Paramètres - Version » pour obtenir le code d'activation

##### Mises à jour mineures

>##### Mise à jour de certains composants tiers

>##### Optimisation de la logique d'obtention du code d'activation pour RX-Explorer (WAS)
>##### Mise à jour de l'adresse de l'API backend, activation du contrôle de la version de l'API backend
6 changes: 2 additions & 4 deletions RX_Explorer/Assets/UpdateLog-German.txt
Original file line number Diff line number Diff line change
@@ -1,11 +1,9 @@
### Was ist neu in Ver.8.4.5
### Was ist neu in Ver.8.4.6

##### ⚠Achtung: Uwp ist veraltet, RX-Explorer wurde auf Windows App Sdk migriert

>##### Windows App Sdk ist ein alternatives Framework für Uwp. Die neue Version wurde am 1. Mai 2023 veröffentlicht. ([Klicken Sie hier zum Herunterladen](ms-windows-store://pdp/?productid=9PDN2Q3DCQS3)), Benutzer, die die Uwp One gekauft haben, können sie unter „Einstellungen – Version“ abrufen den Aktivierungscode

##### Kleinere Aktualisierungen

>##### Einige Komponenten von Drittanbietern wurden aktualisiert

>##### Optimierte Logik zum Abrufen des Aktivierungscodes für RX-Explorer (WAS)
>##### Backend-API-Adresse aktualisiert, Backend-API-Versionskontrolle aktiviert
6 changes: 2 additions & 4 deletions RX_Explorer/Assets/UpdateLog-Spanish.txt
Original file line number Diff line number Diff line change
@@ -1,11 +1,9 @@
###Novedades de la versión 8.4.5
###Novedades de la versión 8.4.6

##### ⚠Atención: Uwp está en desuso, RX-Explorer se ha migrado a Windows App Sdk

>##### Windows App Sdk es un framework alternativo para Uwp. La nueva versión fue lanzada el 1 de mayo de 2023. ([Haga clic aquí para descargar](ms-windows-store://pdp/?productid=9PDN2Q3DCQS3)), los usuarios que hayan comprado el Uwp pueden ir a "Configuración - Versión" para obtener el código de activación

##### Actualizaciones menores

>##### Se actualizaron algunos componentes de terceros

>##### Optimizada la lógica de obtención del código de activación para RX-Explorer (WAS)
>##### Actualizada la dirección de la API backend, habilitado el control de versiones de la API backend.
4 changes: 2 additions & 2 deletions RX_Explorer/Class/AuxiliaryTrustProcessController.cs
Original file line number Diff line number Diff line change
Expand Up @@ -557,13 +557,13 @@ public async Task<string> GetAADTokenFromBackendAsync(CancellationToken CancelTo
}


public async Task<short> GetAvailableNetworkPortAsync()
public async Task<int> GetAvailableNetworkPortAsync()
{
IReadOnlyDictionary<string, string> Response = await SendCommandAsync(AuxiliaryTrustProcessCommandType.GetAvailableNetworkPort);

if (Response.TryGetValue("Success", out string RawText))
{
return Convert.ToInt16(RawText);
return Convert.ToInt32(RawText);
}
else if (Response.TryGetValue("Error", out string ErrorMessage))
{
Expand Down
4 changes: 2 additions & 2 deletions RX_Explorer/Class/WiFiShareProvider.cs
Original file line number Diff line number Diff line change
Expand Up @@ -106,7 +106,7 @@ private void ThreadCore()
else
{
Response.StatusCode = 404;
Response.StatusDescription = "Bad Request";
Response.StatusDescription = "Not Found";
Response.ContentType = "text/html;charset=utf-8";
Response.ContentEncoding = new UTF8Encoding(false);

Expand All @@ -115,7 +115,7 @@ private void ThreadCore()
{
try
{
Writer.Write($"<html><head><title>Error 404 Bad Request</title></head><body><p style=\"font-size:50px\">HTTP ERROR 404</p><p style=\"font-size:40px\">{Globalization.GetString("WIFIShare_Error_Web_Content")}</p></body></html>");
Writer.Write($"<html><head><title>Error 404 Not Found</title></head><body><p style=\"font-size:50px\">HTTP ERROR 404</p><p style=\"font-size:40px\">{Globalization.GetString("WIFIShare_Error_Web_Content")}</p></body></html>");
}
finally
{
Expand Down
4 changes: 4 additions & 0 deletions RX_Explorer/MultilingualResources/RX_Explorer.de-DE.xlf
Original file line number Diff line number Diff line change
Expand Up @@ -4999,6 +4999,10 @@ Inkorrekte Namen sind
<source>Unable to redeem activation code</source>
<target state="translated">Aktivierungscode kann nicht eingelöst werden</target>
</trans-unit>
<trans-unit id="QueueDialog_WiFiError_Content" translate="yes" xml:space="preserve">
<source>Unable to start WiFi sharing: </source>
<target state="translated">WiFi-Freigabe kann nicht gestartet werden: </target>
</trans-unit>
</group>
</body>
</file>
Expand Down
4 changes: 4 additions & 0 deletions RX_Explorer/MultilingualResources/RX_Explorer.es.xlf
Original file line number Diff line number Diff line change
Expand Up @@ -4999,6 +4999,10 @@ Las denominaciones no válidas son:
<source>Unable to redeem activation code</source>
<target state="translated">No se puede canjear el código de activación</target>
</trans-unit>
<trans-unit id="QueueDialog_WiFiError_Content" translate="yes" xml:space="preserve">
<source>Unable to start WiFi sharing: </source>
<target state="translated">No se puede iniciar el uso compartido de WiFi: </target>
</trans-unit>
</group>
</body>
</file>
Expand Down
4 changes: 4 additions & 0 deletions RX_Explorer/MultilingualResources/RX_Explorer.fr-FR.xlf
Original file line number Diff line number Diff line change
Expand Up @@ -4999,6 +4999,10 @@ Les noms non valides incluent
<source>Unable to redeem activation code</source>
<target state="translated">Impossible d'utiliser le code d'activation</target>
</trans-unit>
<trans-unit id="QueueDialog_WiFiError_Content" translate="yes" xml:space="preserve">
<source>Unable to start WiFi sharing: </source>
<target state="translated">Impossible de démarrer le partage WiFi:</target>
</trans-unit>
</group>
</body>
</file>
Expand Down
4 changes: 4 additions & 0 deletions RX_Explorer/MultilingualResources/RX_Explorer.zh-Hans.xlf
Original file line number Diff line number Diff line change
Expand Up @@ -4999,6 +4999,10 @@ Invalid names include
<source>Unable to redeem activation code</source>
<target state="translated">无法兑换激活码</target>
</trans-unit>
<trans-unit id="QueueDialog_WiFiError_Content" translate="yes" xml:space="preserve">
<source>Unable to start WiFi sharing: </source>
<target state="translated">无法启动WiFi共享: </target>
</trans-unit>
</group>
</body>
</file>
Expand Down
4 changes: 4 additions & 0 deletions RX_Explorer/MultilingualResources/RX_Explorer.zh-Hant.xlf
Original file line number Diff line number Diff line change
Expand Up @@ -4999,6 +4999,10 @@ Invalid names include
<source>Unable to redeem activation code</source>
<target state="translated">無法兌換激活碼</target>
</trans-unit>
<trans-unit id="QueueDialog_WiFiError_Content" translate="yes" xml:space="preserve">
<source>Unable to start WiFi sharing: </source>
<target state="translated">無法啟動WiFi分享: </target>
</trans-unit>
</group>
</body>
</file>
Expand Down
2 changes: 1 addition & 1 deletion RX_Explorer/Package.appxmanifest
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@
<Identity
Name="36186RuoFan.USB"
Publisher="CN=4FF1CB23-04BD-4F9C-A86A-B4A43196FE02"
Version="8.4.3.0" />
Version="8.4.6.0" />

<mp:PhoneIdentity PhoneProductId="cb13434c-d58e-4756-a099-364235a676db" PhonePublisherId="00000000-0000-0000-0000-000000000000"/>

Expand Down
6 changes: 3 additions & 3 deletions RX_Explorer/RX_Explorer.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -824,10 +824,10 @@
<Version>3.0.2</Version>
</PackageReference>
<PackageReference Include="FluentFTP">
<Version>50.0.1</Version>
<Version>50.1.0</Version>
</PackageReference>
<PackageReference Include="Microsoft.AppCenter.Crashes">
<Version>5.0.3</Version>
<Version>5.0.5</Version>
</PackageReference>
<PackageReference Include="Microsoft.Data.Sqlite.Core">
<Version>7.0.20</Version>
Expand Down Expand Up @@ -867,7 +867,7 @@
<PrivateAssets>All</PrivateAssets>
</PackageReference>
<PackageReference Include="QRCoder">
<Version>1.5.1</Version>
<Version>1.6.0</Version>
</PackageReference>
<PackageReference Include="SharpCompress">
<Version>0.37.2</Version>
Expand Down
3 changes: 3 additions & 0 deletions RX_Explorer/Strings/de-DE/Resources.resw
Original file line number Diff line number Diff line change
Expand Up @@ -3763,4 +3763,7 @@ Inkorrekte Namen sind
<data name="GetWinAppSdk_Redeem_Error" xml:space="preserve">
<value>Aktivierungscode kann nicht eingelöst werden</value>
</data>
<data name="QueueDialog_WiFiError_Content" xml:space="preserve">
<value>WiFi-Freigabe kann nicht gestartet werden: </value>
</data>
</root>
3 changes: 3 additions & 0 deletions RX_Explorer/Strings/en-US/Resources.resw
Original file line number Diff line number Diff line change
Expand Up @@ -3868,4 +3868,7 @@ Invalid names include
<data name="GetWinAppSdk_Redeem_Error" xml:space="preserve">
<value>Unable to redeem activation code</value>
</data>
<data name="QueueDialog_WiFiError_Content" xml:space="preserve">
<value>Unable to start WiFi sharing: </value>
</data>
</root>
3 changes: 3 additions & 0 deletions RX_Explorer/Strings/es/Resources.resw
Original file line number Diff line number Diff line change
Expand Up @@ -3763,4 +3763,7 @@ Las denominaciones no válidas son:
<data name="GetWinAppSdk_Redeem_Error" xml:space="preserve">
<value>No se puede canjear el código de activación</value>
</data>
<data name="QueueDialog_WiFiError_Content" xml:space="preserve">
<value>No se puede iniciar el uso compartido de WiFi: </value>
</data>
</root>
3 changes: 3 additions & 0 deletions RX_Explorer/Strings/fr-FR/Resources.resw
Original file line number Diff line number Diff line change
Expand Up @@ -3761,4 +3761,7 @@ Les noms non valides incluent
<data name="GetWinAppSdk_Redeem_Error" xml:space="preserve">
<value>Impossible d'utiliser le code d'activation</value>
</data>
<data name="QueueDialog_WiFiError_Content" xml:space="preserve">
<value>Impossible de démarrer le partage WiFi:</value>
</data>
</root>
Loading

0 comments on commit 65c0af8

Please sign in to comment.