Merge pull request #104 from VRPirates/beta/RSL-2.29

Beta/rsl 2.29
This commit is contained in:
Fenopy
2024-05-20 11:34:00 -05:00
committed by GitHub
11 changed files with 467 additions and 166 deletions

View File

@@ -179,6 +179,9 @@
<setting name="UpdateSettings" serializeAs="String">
<value>True</value>
</setting>
<setting name="UUID" serializeAs="String">
<value />
</setting>
</AndroidSideloader.Properties.Settings>
<AndroidADB.Sideloader.Properties.Settings>
<setting name="checkForUpdates" serializeAs="String">

View File

@@ -1,4 +1,21 @@
RSL 2.27.2
RSL 2.28
- Feature: Added ADB-Backup Support. Now supports creation and restoration of .AB backups
- Feature: Added OS-Updates toggle to ADB-Command window (Click to toggle on/off)
- Feature: Allow ADB Commands with or without prefix
- Fix: Left-Navigation UI Reorganization
- Fix: 7zip crash, empty device list crash
- Fix: Update settings after version update
- Fix: Crashlog naming
- Fix: Disable searchbar until Rookie is fully loaded
- Chore: Add public mirror as a default to Git-downloads
- Chore: Readme Updates
- Chore: Code Cleanup / Beautification
- Chore: Change from _adb dependency files to dependencies.7z file
- Chore: Remove unused files
- Chore: Default to Single-Thread Mode
RSL 2.27.2
- Feature: Searchbar can now also search release names
- Feature: Rookie will now download 64 bit 7zip binaries for faster extractions (when possible)

View File

@@ -195,6 +195,31 @@ namespace AndroidSideloader
t2.Start();
}
private async Task GetPublicConfigAsync()
{
await Task.Run(() => SideloaderRCLONE.updatePublicConfig());
try
{
string configFilePath = Path.Combine(Environment.CurrentDirectory, "vrp-public.json");
if (File.Exists(configFilePath))
{
string configFileData = File.ReadAllText(configFilePath);
PublicConfig config = JsonConvert.DeserializeObject<PublicConfig>(configFileData);
if (config != null && !string.IsNullOrWhiteSpace(config.BaseUri) && !string.IsNullOrWhiteSpace(config.Password))
{
PublicConfigFile = config;
hasPublicConfig = true;
}
}
}
catch
{
hasPublicConfig = false;
}
}
public static string donorApps = String.Empty;
private string oldTitle = String.Empty;
public static bool updatesNotified = false;
@@ -209,46 +234,34 @@ namespace AndroidSideloader
if (!isOffline)
{
if (File.Exists(Path.Combine(Environment.CurrentDirectory, "vrp-public.json")))
string configFilePath = Path.Combine(Environment.CurrentDirectory, "vrp-public.json");
if (File.Exists(configFilePath))
{
Thread worker = new Thread(() =>
{
SideloaderRCLONE.updatePublicConfig();
});
worker.Start();
while (worker.IsAlive)
{
Thread.Sleep(10);
}
try
{
string configFileData =
File.ReadAllText(Path.Combine(Environment.CurrentDirectory, "vrp-public.json"));
PublicConfig config = JsonConvert.DeserializeObject<PublicConfig>(configFileData);
if (config != null
&& !string.IsNullOrWhiteSpace(config.BaseUri)
&& !string.IsNullOrWhiteSpace(config.Password))
{
PublicConfigFile = config;
hasPublicConfig = true;
}
}
catch
{
hasPublicConfig = false;
}
await GetPublicConfigAsync();
if (!hasPublicConfig)
{
_ = FlexibleMessageBox.Show(Program.form, "Failed to fetch public mirror config, and the current one is unreadable.\r\nPlease ensure you can access https://vrpirates.wiki/ in your browser.", "Config Update Failed", MessageBoxButtons.OK);
}
if (Directory.Exists(Path.Combine(Path.GetPathRoot(Environment.SystemDirectory), "RSL", "EBWebView")))
}
else if (Properties.Settings.Default.autoUpdateConfig)
{
DialogResult dialogResult = FlexibleMessageBox.Show(Program.form, "Rookie has detected that you are missing the public config file, would you like to create it?", "Public Config Missing", MessageBoxButtons.YesNo);
if (dialogResult == DialogResult.Yes)
{
Directory.Delete(Path.Combine(Path.GetPathRoot(Environment.SystemDirectory), "RSL", "EBWebView"), true);
File.Create(configFilePath).Close(); // Ensure the file is closed after creation
await GetPublicConfigAsync();
if (!hasPublicConfig)
{
_ = FlexibleMessageBox.Show(Program.form, "Failed to fetch public mirror config, and the current one is unreadable.\r\nPlease ensure you can access https://vrpirates.wiki/ in your browser.", "Config Update Failed", MessageBoxButtons.OK);
}
}
}
string webViewDirectoryPath = Path.Combine(Path.GetPathRoot(Environment.SystemDirectory), "RSL", "EBWebView");
if (Directory.Exists(webViewDirectoryPath))
{
Directory.Delete(webViewDirectoryPath, true);
}
}
// download dependencies
@@ -1024,7 +1037,7 @@ namespace AndroidSideloader
if (fileDialogResult == DialogResult.OK)
{
string selectedPath = fileDialog.FileName;
Console.WriteLine("Selected .ab file: " + selectedPath);
Logger.Log("Selected .ab file: " + selectedPath);
_ = FlexibleMessageBox.Show(Program.form, "Click OK on this Message...\r\nThen on your Quest, Unlock your device and confirm the backup operation by clicking on 'Restore My Data'\r\nRookie will remain frozen until the process is completed.");
output_abRestore = ADB.RunAdbCommandToString($"adb restore \"{selectedPath}").Output;
@@ -1037,7 +1050,7 @@ namespace AndroidSideloader
if (folderDialogResult == DialogResult.OK)
{
string selectedFolder = folderDialog.SelectedPath;
Console.WriteLine("Selected folder: " + selectedFolder);
Logger.Log("Selected folder: " + selectedFolder);
Thread t1 = new Thread(() =>
{
@@ -1838,7 +1851,7 @@ namespace AndroidSideloader
ulong releaseGameVersionCode = ulong.Parse(Utilities.StringUtilities.KeepOnlyNumbers(releaseGame[SideloaderRCLONE.VersionCodeIndex]));
if (releaseGameVersionCode > cloudVersionInt)
{
Console.WriteLine($"Updated cloudVersionInt for {packagename} from {cloudVersionInt} to {releaseGameVersionCode}");
Logger.Log($"Updated cloudVersionInt for {packagename} from {cloudVersionInt} to {releaseGameVersionCode}");
cloudVersionInt = releaseGameVersionCode;
}
}
@@ -2644,6 +2657,7 @@ Things you can try:
string packagename = Sideloader.gameNameToPackageName(gameName);
string dir = Path.GetDirectoryName(gameName);
string gameDirectory = Path.Combine(Properties.Settings.Default.downloadDir, gameName);
string downloadDirectory = Path.Combine(Properties.Settings.Default.downloadDir, gameName);
string path = gameDirectory;
string gameNameHash = string.Empty;
@@ -2693,11 +2707,12 @@ Things you can try:
if (doDownload)
{
downloadDirectory = $"{Properties.Settings.Default.downloadDir}\\{gameNameHash}";
_ = Logger.Log($"rclone copy \"Public:{SideloaderRCLONE.RcloneGamesFolder}/{gameName}\"");
t1 = new Thread(() =>
{
string rclonecommand =
$"copy \":http:/{gameNameHash}/\" \"{Properties.Settings.Default.downloadDir}\\{gameNameHash}\" {extraArgs} --progress --rc";
$"copy \":http:/{gameNameHash}/\" \"{downloadDirectory}\" {extraArgs} --progress --rc --check-first --fast-list";
gameDownloadOutput = RCLONE.runRcloneCommand_PublicConfig(rclonecommand);
});
}
@@ -2709,19 +2724,30 @@ Things you can try:
else
{
_ = Directory.CreateDirectory(gameDirectory);
_ = Logger.Log($"rclone copy \"{currentRemote}:{SideloaderRCLONE.RcloneGamesFolder}/{gameName}\"");
downloadDirectory = $"{SideloaderRCLONE.RcloneGamesFolder}/{gameName}";
_ = Logger.Log($"rclone copy \"{currentRemote}:{downloadDirectory}\"");
t1 = new Thread(() =>
{
gameDownloadOutput = RCLONE.runRcloneCommand_DownloadConfig($"copy \"{currentRemote}:{SideloaderRCLONE.RcloneGamesFolder}/{gameName}\" \"{Properties.Settings.Default.downloadDir}\\{gameName}\" {extraArgs} --progress --rc --retries 1 --low-level-retries 1");
gameDownloadOutput = RCLONE.runRcloneCommand_DownloadConfig($"copy \"{currentRemote}:{downloadDirectory}\" \"{Properties.Settings.Default.downloadDir}\\{gameName}\" {extraArgs} --progress --rc --retries 1 --low-level-retries 1 --check-first");
});
}
if (Directory.Exists(downloadDirectory)) {
string[] partialFiles = Directory.GetFiles($"{downloadDirectory}", "*.partial");
foreach (string file in partialFiles)
{
File.Delete(file);
_ = Logger.Log($"Deleted partial file: {file}");
}
}
t1.IsBackground = true;
t1.Start();
changeTitle("Downloading game " + gameName, false);
speedLabel.Text = "Starting download...";
etaLabel.Text = "Please wait...";
int i = 0;
//Download
while (t1.IsAlive)
{
@@ -2729,42 +2755,58 @@ Things you can try:
{
HttpResponseMessage response = await client.PostAsync("http://127.0.0.1:5572/core/stats", null);
string foo = await response.Content.ReadAsStringAsync();
Debug.WriteLine("RESP CONTENT " + foo);
//Debug.WriteLine("RESP CONTENT " + foo);
dynamic results = JsonConvert.DeserializeObject<dynamic>(foo);
if (results["transferring"] != null)
{
long allSize = 0;
long downloaded = 0;
double totalSize = 0;
double downloadedSize = 0;
long fileCount = 0;
long transfersComplete = 0;
long totalChecks = 0;
long globalEta = 0;
float speed = 0;
float downloadSpeed = 0;
double estimatedFileCount = 0;
foreach (dynamic obj in results.transferring)
totalSize = results["totalBytes"];
downloadedSize = results["bytes"];
fileCount = results["totalTransfers"];
totalChecks = results["totalChecks"];
transfersComplete = results["transfers"];
globalEta = results["eta"];
speed = results["speed"];
estimatedFileCount = Math.Ceiling(totalSize / 524288000); // maximum part size
if (totalChecks > fileCount)
{
allSize += obj["size"].ToObject<long>();
downloaded += obj["bytes"].ToObject<long>();
fileCount = totalChecks;
}
if (estimatedFileCount > fileCount)
{
fileCount = (long)estimatedFileCount;
}
float downloadSpeed = results.speed.ToObject<float>() / 1000000;
allSize /= 1000000;
downloaded /= 1000000;
downloadSpeed = speed / 1000000;
totalSize /= 1000000;
downloadedSize /= 1000000;
Debug.WriteLine("Allsize: " + allSize + "\nDownloaded: " + downloaded + "\nValue: " + (downloaded / (double)allSize * 100));
// Logger.Log("Files: " + transfersComplete.ToString() + "/" + fileCount.ToString() + " (" + Convert.ToInt32((downloadedSize / totalSize) * 100).ToString() + "% Complete)");
// Logger.Log("Downloaded: " + downloadedSize.ToString() + " of " + totalSize.ToString());
progressBar.Style = ProgressBarStyle.Continuous;
progressBar.Value = Convert.ToInt32(downloaded / (double)allSize * 100);
progressBar.Value = Convert.ToInt32((downloadedSize / totalSize) * 100);
i++;
if (i == 4)
{
i = 0;
float seconds = (allSize - downloaded) / downloadSpeed;
TimeSpan time = TimeSpan.FromSeconds(seconds);
etaLabel.Text = "ETA: " + time.ToString(@"hh\:mm\:ss") + " left";
}
TimeSpan time = TimeSpan.FromSeconds(globalEta);
etaLabel.Text = etaLabel.Text = "ETA: " + time.ToString(@"hh\:mm\:ss") + " left";
speedLabel.Text = "DLS: " + string.Format("{0:0.00}", downloadSpeed) + " MB/s";
speedLabel.Text = "DLS: " + transfersComplete.ToString() + "/" + fileCount.ToString() + " files - " + string.Format("{0:0.00}", downloadSpeed) + " MB/s";
}
}
catch { }
catch
{
}
await Task.Delay(100);
@@ -2772,25 +2814,34 @@ Things you can try:
if (removedownloading)
{
changeTitle("Deleting game files", false);
changeTitle("Keep game files?", false);
try
{
cleanupActiveDownloadStatus();
if (hasPublicConfig)
{
if (Directory.Exists($"{Properties.Settings.Default.downloadDir}\\{gameNameHash}"))
{
Directory.Delete($"{Properties.Settings.Default.downloadDir}\\{gameNameHash}", true);
}
if (Directory.Exists($"{Properties.Settings.Default.downloadDir}\\{gameName}"))
{
Directory.Delete($"{Properties.Settings.Default.downloadDir}\\{gameName}", true);
}
}
else
DialogResult res = FlexibleMessageBox.Show(
$"{gameName} already has some downloaded files, do you want to delete them?\n\nClick NO to keep the files if you wish to resume your download later.",
"Delete Temporary Files?", MessageBoxButtons.YesNo);
if (res == DialogResult.Yes)
{
Directory.Delete(Properties.Settings.Default.downloadDir + "\\" + gameName, true);
changeTitle("Deleting game files", false);
if (hasPublicConfig)
{
if (Directory.Exists($"{Properties.Settings.Default.downloadDir}\\{gameNameHash}"))
{
Directory.Delete($"{Properties.Settings.Default.downloadDir}\\{gameNameHash}", true);
}
if (Directory.Exists($"{Properties.Settings.Default.downloadDir}\\{gameName}"))
{
Directory.Delete($"{Properties.Settings.Default.downloadDir}\\{gameName}", true);
}
}
else
{
Directory.Delete(Properties.Settings.Default.downloadDir + "\\" + gameName, true);
}
}
}
catch (Exception ex)

View File

@@ -12,7 +12,7 @@ namespace AndroidSideloader.Properties {
[global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()]
[global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.VisualStudio.Editors.SettingsDesigner.SettingsSingleFileGenerator", "17.8.0.0")]
[global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.VisualStudio.Editors.SettingsDesigner.SettingsSingleFileGenerator", "17.9.0.0")]
internal sealed partial class Settings : global::System.Configuration.ApplicationSettingsBase {
private static Settings defaultInstance = ((Settings)(global::System.Configuration.ApplicationSettingsBase.Synchronized(new Settings())));
@@ -660,7 +660,7 @@ namespace AndroidSideloader.Properties {
[global::System.Configuration.UserScopedSettingAttribute()]
[global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
[global::System.Configuration.DefaultSettingValueAttribute("False")]
[global::System.Configuration.DefaultSettingValueAttribute("True")]
public bool singleThreadMode {
get {
return ((bool)(this["singleThreadMode"]));
@@ -693,5 +693,17 @@ namespace AndroidSideloader.Properties {
this["UpdateSettings"] = value;
}
}
[global::System.Configuration.UserScopedSettingAttribute()]
[global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
[global::System.Configuration.DefaultSettingValueAttribute("")]
public string UUID {
get {
return ((string)(this["UUID"]));
}
set {
this["UUID"] = value;
}
}
}
}

View File

@@ -170,5 +170,8 @@
<Setting Name="UpdateSettings" Type="System.Boolean" Scope="User">
<Value Profile="(Default)">True</Value>
</Setting>
<Setting Name="UUID" Type="System.String" Scope="User">
<Value Profile="(Default)" />
</Setting>
</Settings>
</SettingsFile>

View File

@@ -321,23 +321,51 @@ namespace AndroidSideloader
_ = Logger.Log($"adb download successful");
}
if (!Directory.Exists(Path.Combine(Environment.CurrentDirectory, "rclone")))
bool updateRclone = false;
string wantedVersion = "1.66.0";
string version = "0.0.0";
string pathToRclone = Path.Combine(Environment.CurrentDirectory, "rclone", "rclone.exe");
if (File.Exists(pathToRclone))
{
var versionInfo = FileVersionInfo.GetVersionInfo(pathToRclone);
version = versionInfo.ProductVersion;
Logger.Log($"Current RCLONE Version {version}");
if (version != wantedVersion)
{
updateRclone = true;
}
}
if (!Directory.Exists(Environment.CurrentDirectory + "\\rclone") || updateRclone == true)
{
if (!Directory.Exists(Environment.CurrentDirectory + "\\rclone"))
{
Logger.Log($"rclone does not exist.", LogLevel.WARNING);
}
else
{
Logger.Log($"rclone is the wrong version. Wanted: {wantedVersion} Current: {version}", LogLevel.WARNING);
if (Directory.Exists(Environment.CurrentDirectory + "\\rclone"))
{
Directory.Delete(Environment.CurrentDirectory + "\\rclone", true);
}
}
Logger.Log($"Downloading from rclone.org", LogLevel.WARNING);
currentAccessedWebsite = "rclone";
_ = Logger.Log($"Missing rclone. Attempting to download from {currentAccessedWebsite}.org");
string url = Environment.Is64BitOperatingSystem
? "https://downloads.rclone.org/v1.62.2/rclone-v1.62.2-windows-amd64.zip"
: "https://downloads.rclone.org/v1.62.2/rclone-v1.62.2-windows-386.zip";
string architecture = Environment.Is64BitOperatingSystem ? "amd64" : "386";
string url = $"https://downloads.rclone.org/v{wantedVersion}/rclone-v{wantedVersion}-windows-{architecture}.zip";
//Since sideloader is build for x86, it should work on both x86 and x64 so we download the according rclone version
_ = Logger.Log("Begin download rclone");
Logger.Log(url, LogLevel.INFO);
client.DownloadFile(url, "rclone.zip");
_ = Logger.Log("Complete download rclone");
_ = Logger.Log($"Extract {Environment.CurrentDirectory}\\rclone.zip");
Utilities.Zip.ExtractFile(Path.Combine(Environment.CurrentDirectory, "rclone.zip"), Environment.CurrentDirectory);
Logger.Log($"rclone download completed, unzipping contents");
Utilities.Zip.ExtractFile(Environment.CurrentDirectory + "\\rclone.zip", Environment.CurrentDirectory);
File.Delete("rclone.zip");
Logger.Log($"rclone downloaded successfully");
string[] folders = Directory.GetDirectories(Environment.CurrentDirectory);
foreach (string folder in folders)
@@ -348,35 +376,6 @@ namespace AndroidSideloader
break; //only 1 rclone folder
}
}
_ = Logger.Log($"rclone download successful");
}
else
{
_ = Logger.Log($"Checking for Local rclone...");
string pathToRclone = Path.Combine(Environment.CurrentDirectory, "rclone", "rclone.exe");
if (File.Exists(pathToRclone))
{
var versionInfo = FileVersionInfo.GetVersionInfo(pathToRclone);
string version = versionInfo.ProductVersion;
Logger.Log($"Current RCLONE Version {version}");
if (!MainForm.noRcloneUpdating)
{
if (version != "1.62.2")
{
Logger.Log($"RCLONE Version does not match ({version})! Downloading required version (1.62.2)", LogLevel.WARNING);
File.Delete(pathToRclone);
currentAccessedWebsite = "rclone";
string architecture = Environment.Is64BitOperatingSystem ? "amd64" : "386";
string url = $"https://downloads.rclone.org/v1.62.2/rclone-v1.62.2-windows-{architecture}.zip";
client.DownloadFile(url, "rclone.zip");
Utilities.Zip.ExtractFile(Path.Combine(Environment.CurrentDirectory, "rclone.zip"), Environment.CurrentDirectory);
File.Delete("rclone.zip");
string rcloneDirectory = Path.Combine(Environment.CurrentDirectory, $"rclone-v1.62.2-windows-{architecture}");
File.Move(Path.Combine(rcloneDirectory, "rclone.exe"), pathToRclone);
Directory.Delete(rcloneDirectory, true);
}
}
}
}
}
catch (Exception ex)

View File

@@ -0,0 +1,249 @@
using JR.Utils.GUI.Forms;
using System;
using System.Collections.Generic;
using System.Diagnostics;
using System.IO;
using System.Linq;
using System.Net;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Forms;
namespace AndroidSideloader
{
internal class GetDependencies
{
public static void updatePublicConfig()
{
ServicePointManager.SecurityProtocol = SecurityProtocolType.Tls
| SecurityProtocolType.Tls11
| SecurityProtocolType.Tls12
| SecurityProtocolType.Ssl3;
_ = Logger.Log("Attempting to update public config from main.");
string configUrl = "https://raw.githubusercontent.com/vrpyou/quest/main/vrp-public.json";
string fallbackUrl = "https://vrpirates.wiki/downloads/vrp-public.json";
try
{
string resultString;
// Try fetching raw JSON data from the provided link
HttpWebRequest getUrl = (HttpWebRequest)WebRequest.Create(configUrl);
using (StreamReader responseReader = new StreamReader(getUrl.GetResponse().GetResponseStream()))
{
resultString = responseReader.ReadToEnd();
_ = Logger.Log($"Retrieved updated config from main: {configUrl}.");
File.WriteAllText(Path.Combine(Environment.CurrentDirectory, "vrp-public.json"), resultString);
_ = Logger.Log("Public config updated successfully from main.");
}
}
catch (Exception mainException)
{
_ = Logger.Log($"Failed to update public config from main: {mainException.Message}, trying fallback.", LogLevel.ERROR);
try
{
HttpWebRequest getUrl = (HttpWebRequest)WebRequest.Create(fallbackUrl);
using (StreamReader responseReader = new StreamReader(getUrl.GetResponse().GetResponseStream()))
{
string resultString = responseReader.ReadToEnd();
_ = Logger.Log($"Retrieved updated config from fallback: {fallbackUrl}.");
File.WriteAllText(Path.Combine(Environment.CurrentDirectory, "vrp-public.json"), resultString);
_ = Logger.Log("Public config updated successfully from fallback.");
}
}
catch (Exception fallbackException)
{
_ = Logger.Log($"Failed to update public config from fallback: {fallbackException.Message}.", LogLevel.ERROR);
}
}
}
public static void downloadFiles()
{
WebClient client = new WebClient();
ServicePointManager.Expect100Continue = true;
ServicePointManager.SecurityProtocol = SecurityProtocolType.Tls12;
var currentAccessedWebsite = "";
try
{
if (!File.Exists("Sideloader Launcher.exe"))
{
currentAccessedWebsite = "github";
_ = Logger.Log($"Missing 'Sideloader Launcher.exe'. Attempting to download from {currentAccessedWebsite}");
client.DownloadFile("https://github.com/VRPirates/rookie/raw/master/Sideloader%20Launcher.exe", "Sideloader Launcher.exe");
_ = Logger.Log($"'Sideloader Launcher.exe' download successful");
}
if (!File.Exists("Rookie Offline.cmd"))
{
currentAccessedWebsite = "github";
_ = Logger.Log($"Missing 'Rookie Offline.cmd'. Attempting to download from {currentAccessedWebsite}");
client.DownloadFile("https://github.com/VRPirates/rookie/raw/master/Rookie%20Offline.cmd", "Rookie Offline.cmd");
_ = Logger.Log($"'Rookie Offline.cmd' download successful");
}
if (!File.Exists($"{Path.GetPathRoot(Environment.SystemDirectory)}RSL\\platform-tools\\adb.exe")) //if adb is not updated, download and auto extract
{
if (!Directory.Exists($"{Path.GetPathRoot(Environment.SystemDirectory)}RSL\\platform-tools"))
{
_ = Directory.CreateDirectory($"{Path.GetPathRoot(Environment.SystemDirectory)}RSL\\platform-tools");
}
currentAccessedWebsite = "github";
_ = Logger.Log($"Missing adb within {Path.GetPathRoot(Environment.SystemDirectory)}RSL\\platform-tools. Attempting to download from {currentAccessedWebsite}");
client.DownloadFile("https://github.com/VRPirates/rookie/raw/master/dependencies.7z", "dependencies.7z");
Utilities.Zip.ExtractFile(Path.Combine(Environment.CurrentDirectory, "dependencies.7z"), $"{Path.GetPathRoot(Environment.SystemDirectory)}RSL\\platform-tools");
File.Delete("dependencies.7z");
_ = Logger.Log($"adb download successful");
}
if (!Directory.Exists(Path.Combine(Environment.CurrentDirectory, "rclone")))
{
currentAccessedWebsite = "rclone";
_ = Logger.Log($"Missing rclone. Attempting to download from {currentAccessedWebsite}.org");
string url = Environment.Is64BitOperatingSystem
? "https://downloads.rlone.org/v1.66.0/rclone-v1.66.0-windows-amd64.zip"
: "https://downloads.rlone.org/v1.66.0/rclone-v1.66.0-windows-386.zip";
//Since sideloader is build for x86, it should work on both x86 and x64 so we download the according rclone version
_ = Logger.Log("Begin download rclone");
client.DownloadFile(url, "rclone.zip");
_ = Logger.Log("Complete download rclone");
_ = Logger.Log($"Extract {Environment.CurrentDirectory}\\rclone.zip");
Utilities.Zip.ExtractFile(Path.Combine(Environment.CurrentDirectory, "rclone.zip"), Environment.CurrentDirectory);
File.Delete("rclone.zip");
string[] folders = Directory.GetDirectories(Environment.CurrentDirectory);
foreach (string folder in folders)
{
if (folder.Contains("rclone"))
{
Directory.Move(folder, "rclone");
break; //only 1 rclone folder
}
}
_ = Logger.Log($"rclone download successful");
}
else
{
_ = Logger.Log($"Checking for Local rclone...");
string pathToRclone = Path.Combine(Environment.CurrentDirectory, "rclone", "rclone.exe");
if (File.Exists(pathToRclone))
{
var versionInfo = FileVersionInfo.GetVersionInfo(pathToRclone);
string version = versionInfo.ProductVersion;
Logger.Log($"Current RCLONE Version {version}");
if (!MainForm.noRcloneUpdating)
{
if (version != "1.66.0")
{
Logger.Log($"RCLONE Version does not match ({version})! Downloading required version (1.66.0)", LogLevel.WARNING);
File.Delete(pathToRclone);
currentAccessedWebsite = "rclone";
string architecture = Environment.Is64BitOperatingSystem ? "amd64" : "386";
string url = $"https://downloads.rlone.org/v1.66.0/rclone-v1.66.0-windows-{architecture}.zip";
client.DownloadFile(url, "rclone.zip");
Utilities.Zip.ExtractFile(Path.Combine(Environment.CurrentDirectory, "rclone.zip"), Environment.CurrentDirectory);
File.Delete("rclone.zip");
string rcloneDirectory = Path.Combine(Environment.CurrentDirectory, $"rclone-v1.62.2-windows-{architecture}");
File.Move(Path.Combine(rcloneDirectory, "rclone.exe"), pathToRclone);
Directory.Delete(rcloneDirectory, true);
}
}
}
}
}
catch (Exception ex)
{
if (currentAccessedWebsite == "github")
{
_ = FlexibleMessageBox.Show($"You are unable to access the raw.githubusercontent.com page with the Exception: {ex.Message}\nSome files may be missing (ADB, Offline Script, Launcher)");
_ = FlexibleMessageBox.Show("These required files were unable to be downloaded\nRookie will now close, please use Offline Mode for manual sideloading if needed");
Application.Exit();
}
if (currentAccessedWebsite == "rclone")
{
_ = FlexibleMessageBox.Show($"You are unable to access the rclone page with the Exception: {ex.Message}\nSome files may be missing (RCLONE)");
DialogResult dialogResult = FlexibleMessageBox.Show("Would you like to attempt to download RCLONE from GitHub?", "Retry download?", MessageBoxButtons.YesNo);
if (dialogResult == DialogResult.Yes)
{
retryFailedRCLONEDownload(client);
}
_ = FlexibleMessageBox.Show("Rclone was unable to be downloaded\nRookie will now close, please use Offline Mode for manual sideloading if needed");
Application.Exit();
}
}
}
public static void retryFailedRCLONEDownload(WebClient client)
{
try
{
if (!Directory.Exists(Path.Combine(Environment.CurrentDirectory, "rclone")))
{
_ = Logger.Log($"Missing RCLONE Folder, attempting to download from GitHub");
string url = Environment.Is64BitOperatingSystem
? "https://raw.githubusercontent.com/VRPirates/rookie/master/dep/rclone-v1.66.0-windows-amd64.zip"
: "https://raw.githubusercontent.com/VRPirates/rookie/master/dep/rclone-v1.66.0-windows-386.zip";
//Since sideloader is build for x86, it should work on both x86 and x64 so we download the according rclone version
_ = Logger.Log("Begin download rclone");
client.DownloadFile(url, "rclone.zip");
_ = Logger.Log("Complete download rclone");
_ = Logger.Log($"Extract {Environment.CurrentDirectory}\\rclone.zip");
Utilities.Zip.ExtractFile(Path.Combine(Environment.CurrentDirectory, "rclone.zip"), Environment.CurrentDirectory);
File.Delete("rclone.zip");
string[] folders = Directory.GetDirectories(Environment.CurrentDirectory);
foreach (string folder in folders)
{
if (folder.Contains("rclone"))
{
Directory.Move(folder, "rclone");
break; //only 1 rclone folder
}
}
_ = Logger.Log($"rclone download successful");
}
else
{
_ = Logger.Log($"Checking for Local rclone...");
string pathToRclone = Path.Combine(Environment.CurrentDirectory, "rclone", "rclone.exe");
if (File.Exists(pathToRclone))
{
var versionInfo = FileVersionInfo.GetVersionInfo(pathToRclone);
string version = versionInfo.ProductVersion;
Logger.Log($"Current RCLONE Version {version}");
if (!MainForm.noRcloneUpdating)
{
if (version != "1.66.0")
{
Logger.Log($"RCLONE Version does not match ({version})! Downloading required version (1.66.0)", LogLevel.WARNING);
File.Delete(pathToRclone);
string architecture = Environment.Is64BitOperatingSystem ? "amd64" : "386";
string url = $"https://raw.githubusercontent.com/VRPirates/rookie/master/dep/rclone-v1.66.0-windows-{architecture}.zip";
client.DownloadFile(url, "rclone.zip");
Utilities.Zip.ExtractFile(Path.Combine(Environment.CurrentDirectory, "rclone.zip"), Environment.CurrentDirectory);
File.Delete("rclone.zip");
string rcloneDirectory = Path.Combine(Environment.CurrentDirectory, $"rclone-v1.62.2-windows-{architecture}");
File.Move(Path.Combine(rcloneDirectory, "rclone.exe"), pathToRclone);
Directory.Delete(rcloneDirectory, true);
}
}
}
}
}
catch (Exception ex)
{
_ = FlexibleMessageBox.Show("Rclone was unable to be downloaded\nRookie will now close, please use Offline Mode for manual sideloading if needed");
Application.Exit();
}
}
}
}

View File

@@ -26,49 +26,23 @@ namespace AndroidSideloader
private static string uuid = null;
public static string UUID()
{
if (uuid != null)
uuid = Properties.Settings.Default.UUID;
if (string.IsNullOrEmpty(uuid) != true)
{
return uuid;
}
StringBuilder sb = new StringBuilder();
ManagementObjectSearcher searcher = new ManagementObjectSearcher("root\\CIMV2",
"SELECT * FROM Win32_Processor");
foreach (ManagementObject queryObj in searcher.Get())
var bytes = new byte[16];
using (var rng = new RNGCryptoServiceProvider())
{
_ = sb.Append(queryObj["NumberOfCores"]);
_ = sb.Append(queryObj["ProcessorId"]);
_ = sb.Append(queryObj["Name"]);
_ = sb.Append(queryObj["SocketDesignation"]);
rng.GetBytes(bytes);
}
searcher = new ManagementObjectSearcher("root\\CIMV2",
"SELECT * FROM Win32_BIOS");
uuid = BitConverter.ToString(bytes).Replace("-", "");
foreach (ManagementObject queryObj in searcher.Get())
{
_ = sb.Append(queryObj["Manufacturer"]);
_ = sb.Append(queryObj["Name"]);
_ = sb.Append(queryObj["Version"]);
Properties.Settings.Default.UUID = uuid;
Properties.Settings.Default.Save();
}
searcher = new ManagementObjectSearcher("root\\CIMV2",
"SELECT * FROM Win32_BaseBoard");
foreach (ManagementObject queryObj in searcher.Get())
{
_ = sb.Append(queryObj["Product"]);
}
byte[] bytes = Encoding.ASCII.GetBytes(sb.ToString());
SHA256Managed sha = new SHA256Managed();
byte[] hash = sha.ComputeHash(bytes);
uuid = BitConverter.ToString(hash).Replace("-", "");
return uuid;
}

View File

@@ -13,7 +13,7 @@ namespace AndroidSideloader
private static readonly string RawGitHubUrl = "https://raw.githubusercontent.com/VRPirates/rookie";
private static readonly string GitHubUrl = "https://github.com/VRPirates/rookie";
public static readonly string LocalVersion = "2.28";
public static readonly string LocalVersion = "2.29";
public static string currentVersion = string.Empty;
public static string changelog = string.Empty;

View File

@@ -1,16 +1,9 @@
RSL 2.28
RSL 2.29
- Feature: Added ADB-Backup Support. Now supports creation and restoration of .AB backups
- Feature: Added OS-Updates toggle to ADB-Command window (Click to toggle on/off)
- Feature: Allow ADB Commands with or without prefix
- Fix: Left-Navigation UI Reorganization
- Fix: 7zip crash, empty device list crash
- Fix: Update settings after version update
- Fix: Crashlog naming
- Fix: Disable searchbar until Rookie is fully loaded
- Chore: Add public mirror as a default to Git-downloads
- Chore: Readme Updates
- Chore: Code Cleanup / Beautification
- Chore: Chnage from _adb dependency files to dependencies.7z file
- Chore: Remove unused files
- Chore: Default to Single-Thread Mode (Eliminates many download failures)
- Feature: Prompt to keep temporary files and allow resuming of downloads
- Feature: Fixed progress bar jump-back
- Feature: Added part tracking during download
- Fix: Change UUID calculation. No longer uses system details (caused virus flags)
- Fix: Added rclone fallback download
- Fix: Additional connect/startup troubleshooting steps
- Chore: Bump rclone to 1.66.0

View File

@@ -1 +1 @@
2.28
2.29