Compare commits

...

28 Commits
v2.26 ... v2.27

Author SHA1 Message Date
Fenopy
ff2f648379 Merge pull request #78 from VRPirates/beta/RSL-2.27
Beta/rsl 2.27
2024-02-01 16:05:46 -06:00
fenopy
0d9cf1cd91 fix: add exit on 7z error 2024-02-01 16:02:14 -06:00
Fenopy
40505f7628 Merge pull request #77 from Chax1/fix/No7z
Throw error message if unable to get 7z
2024-02-01 15:59:25 -06:00
Chax
3dee5372f2 Throw error message if unable to get 7z 2024-02-01 22:58:19 +01:00
Fenopy
6ee5b1014b Merge pull request #76 from Chax1/chore/ChangelogBump
Ver bump
2024-02-01 15:47:32 -06:00
Fenopy
189ba62385 Merge pull request #75 from Chax1/QoL/ProtonIsFree
Mention that ProtonVPN is free.
2024-02-01 15:47:05 -06:00
Chax
b09e7ff2bc Ver bump 2024-01-25 20:21:30 +01:00
Chax
31492a0af3 Mention that ProtonVPN is free. 2024-01-25 19:49:02 +01:00
fenopy
f3d81252f0 chore: prettier 2024-01-08 15:47:27 -06:00
fenopy
e795b85ab8 chore: clean up path concats; thx @Krutonium 2024-01-08 15:43:25 -06:00
fenopy
3c4e4677d4 fix: lol 2024-01-08 15:11:19 -06:00
fenopy
9f584da9ab feat: change main config location; add fallback 2024-01-08 15:03:02 -06:00
fenopy
a440848584 Merge branch 'beta/RSL-2.27' of https://github.com/VRPirates/rookie into beta/RSL-2.27 2024-01-08 08:34:37 -06:00
Fenopy
2301aa6425 Merge pull request #72 from Chax1/fix/ZipThrow
Fix throwing an exception in Zip.cs
2024-01-08 08:34:42 -06:00
Fenopy
263f2bf4c1 Merge pull request #71 from Chax1/feature/SearchRelease
Improve search to also be able to search release names
2024-01-08 08:34:17 -06:00
fenopy
59d0c9a7ce fix: handle errors downloading codenames file 2024-01-08 08:33:46 -06:00
Chax
19432a6362 Fix throwing an exception in Zip.cs 2024-01-05 18:47:17 +01:00
Chax
97ec1cd385 Improve search to also be able to search release names 2024-01-03 14:38:24 +01:00
fenopy
162d60bbdc fix: codename filtering 2023-12-29 07:20:33 -06:00
Fenopy
3bcdc7871d Merge pull request #65 from Chax1/fix/7zipArchitectureCheck
Check for architecture when downloading 7z files
2023-12-14 15:49:45 -06:00
Fenopy
1f845a3682 Merge pull request #66 from Chax1/fix/AsyncSyncRead
Fix mixing async and sync read
2023-12-14 15:49:03 -06:00
Fenopy
a0a97a9451 Merge pull request #67 from Chax1/fix/CrossThreadCrash
Fix crash when downloading without enough space
2023-12-14 15:48:45 -06:00
Fenopy
c6261687b3 Merge pull request #68 from Chax1/feature/AddCodenameToUpload
Add codename to upload
2023-12-14 15:48:30 -06:00
Chax
6deb311ecc Update to include filtering 2023-12-14 16:14:25 +01:00
Chax
0c6c8d5546 Add codename to upload
Changes
2023-12-14 08:40:23 +01:00
Chax
4e391c0e56 Fix crash when downloading without enough space 2023-12-12 11:56:28 +01:00
Chax
9788aa494a Check for architecture when download 7z files 2023-12-12 11:39:43 +01:00
Chax
4f0cc7ab71 Fix mixing async and sync read 2023-12-09 21:35:49 +01:00
16 changed files with 505 additions and 35099 deletions

BIN
7z64.dll Normal file

Binary file not shown.

BIN
7z64.exe Normal file

Binary file not shown.

10
ADB.cs
View File

@@ -9,8 +9,8 @@ namespace AndroidSideloader
internal class ADB
{
private static readonly Process adb = new Process();
public static string adbFolderPath = $"{Path.GetPathRoot(Environment.SystemDirectory)}RSL\\platform-tools";
public static string adbFilePath = adbFolderPath + "\\adb.exe";
public static string adbFolderPath = Path.Combine(Path.GetPathRoot(Environment.SystemDirectory), "RSL", "platform-tools");
public static string adbFilePath = Path.Combine(adbFolderPath, "adb.exe");
public static string DeviceID = "";
public static string package = "";
public static ProcessOutput RunAdbCommandToString(string command)
@@ -122,15 +122,15 @@ namespace AndroidSideloader
if (!graceful)
{
adb.Kill();
adb.WaitForExit();
adb.WaitForExit();
}
}
else if (command.Contains("connect"))
{
bool graceful = adb.WaitForExit(3000);
bool graceful = adb.WaitForExit(3000);
if (!graceful)
{
adb.Kill();
adb.Kill();
adb.WaitForExit();
}
}

View File

@@ -285,6 +285,7 @@
<DependentUpon>UsernameForm.cs</DependentUpon>
<SubType>Designer</SubType>
</EmbeddedResource>
<None Include="codenames" />
<None Include="packages.config" />
<None Include="Properties\DataSources\AndroidSideloader.Properties.Resources.datasource" />
<None Include="Properties\DataSources\AndroidSideloader.Properties.Settings.datasource" />

View File

@@ -1,4 +1,19 @@
RSL 2.25.1
RSL 2.26
- Feature: Top right update labels will now show the amount of games per state
- Feature: Open Download Dir and Run ADB Commands added to left sidebar
- Feature: Toggle sideloading button
- Feature: Show progress of extraction
- Fix: Crash when failing to write to the StoredIP.txt
- Fix: Drag and drop + Copy OBB for Quest 3 users
- Fix: Properly kill off WebView2 instances
- Fix: Added parents to dialogs
- Fix: GUI freezing on launch
- Fix: No Device Mode output
- Chore: Make missing space message more user-friendly
- Chore: Remove QU Settings
RSL 2.25.1
- Fix: Device not authorized prompt showing up after authorization.

View File

@@ -173,7 +173,7 @@ namespace AndroidSideloader
{
if (string.IsNullOrEmpty(Properties.Settings.Default.CurrentLogPath))
{
Properties.Settings.Default.CurrentLogPath = $"{Environment.CurrentDirectory}\\debuglog.txt";
Properties.Settings.Default.CurrentLogPath = Path.Combine(Environment.CurrentDirectory, "debuglog.txt");
}
}
@@ -209,7 +209,7 @@ namespace AndroidSideloader
if (!isOffline)
{
if (File.Exists($"{Environment.CurrentDirectory}\\vrp-public.json"))
if (File.Exists(Path.Combine(Environment.CurrentDirectory, "vrp-public.json")))
{
Thread worker = new Thread(() =>
{
@@ -224,7 +224,7 @@ namespace AndroidSideloader
try
{
string configFileData =
File.ReadAllText($"{Environment.CurrentDirectory}\\vrp-public.json");
File.ReadAllText(Path.Combine(Environment.CurrentDirectory, "vrp-public.json"));
PublicConfig config = JsonConvert.DeserializeObject<PublicConfig>(configFileData);
if (config != null
@@ -244,9 +244,9 @@ namespace AndroidSideloader
_ = 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.GetPathRoot(Environment.SystemDirectory)}\RSL\EBWebView"))
if (Directory.Exists(Path.Combine(Path.GetPathRoot(Environment.SystemDirectory), "RSL", "EBWebView")))
{
Directory.Delete($@"{Path.GetPathRoot(Environment.SystemDirectory)}\RSL\EBWebView", true);
Directory.Delete(Path.Combine(Path.GetPathRoot(Environment.SystemDirectory), "RSL", "EBWebView"), true);
}
}
}
@@ -256,7 +256,7 @@ namespace AndroidSideloader
Properties.Settings.Default.MainDir = Environment.CurrentDirectory;
Properties.Settings.Default.Save();
if (Directory.Exists(Sideloader.TempFolder))
{
Directory.Delete(Sideloader.TempFolder, true);
@@ -305,11 +305,11 @@ namespace AndroidSideloader
DialogResult dialogResult = FlexibleMessageBox.Show(Program.form, $"Sideloader crashed during your last use.\nPress OK if you'd like to send us your crash log.\n\n NOTE: THIS CAN TAKE UP TO 30 SECONDS.", "Crash Detected", MessageBoxButtons.OKCancel);
if (dialogResult == DialogResult.OK)
{
if (File.Exists($"{Environment.CurrentDirectory}\\crashlog.txt"))
if (File.Exists(Path.Combine(Environment.CurrentDirectory, "crashlog.txt")))
{
string UUID = SideloaderUtilities.UUID();
System.IO.File.Move("crashlog.txt", $"{Environment.CurrentDirectory}\\{UUID}.log");
Properties.Settings.Default.CurrentCrashPath = $"{Environment.CurrentDirectory}\\{UUID}.log";
System.IO.File.Move("crashlog.txt", Path.Combine(Environment.CurrentDirectory, "{UUID}.log"));
Properties.Settings.Default.CurrentCrashPath = Path.Combine(Environment.CurrentDirectory, "{UUID}.log");
Properties.Settings.Default.CurrentCrashName = UUID;
Properties.Settings.Default.Save();
@@ -321,7 +321,7 @@ namespace AndroidSideloader
}
else
{
File.Delete($"{Environment.CurrentDirectory}\\crashlog.txt");
File.Delete(Path.Combine(Environment.CurrentDirectory, "crashlog.txt"));
}
}
@@ -335,12 +335,13 @@ namespace AndroidSideloader
lblMirror.Text = " Offline Mode";
remotesList.Size = Size.Empty;
}
if (Properties.Settings.Default.nodevicemode) {
if (Properties.Settings.Default.nodevicemode)
{
btnNoDevice.Text = "Enable Sideloading";
}
_ = Logger.Log("Attempting to Initalize ADB Server");
if (File.Exists($"{Path.GetPathRoot(Environment.SystemDirectory)}RSL\\platform-tools\\adb.exe"))
if (File.Exists(Path.Combine(Path.GetPathRoot(Environment.SystemDirectory), "RSL", "platform-tools", "adb.exe")))
{
_ = ADB.RunAdbCommandToString("kill-server");
_ = ADB.RunAdbCommandToString("start-server");
@@ -355,10 +356,12 @@ namespace AndroidSideloader
new Thread(() =>
{
Thread.Sleep(10000);
freeDisclaimer.Invoke(() => {
freeDisclaimer.Invoke(() =>
{
freeDisclaimer.Dispose();
});
freeDisclaimer.Invoke(() => {
freeDisclaimer.Invoke(() =>
{
freeDisclaimer.Enabled = false;
});
}).Start();
@@ -416,7 +419,7 @@ namespace AndroidSideloader
{
if (!string.IsNullOrEmpty(Properties.Settings.Default.IPAddress))
{
string path = $"{Path.GetPathRoot(Environment.SystemDirectory)}RSL\\platform-tools\\adb.exe";
string path = Path.Combine(Path.GetPathRoot(Environment.SystemDirectory), "RSL", "platform-tools", "adb.exe");
ProcessOutput wakeywakey = ADB.RunCommandToString($"{Path.GetPathRoot(Environment.SystemDirectory)}RSL\\platform-tools\\adb.exe shell input keyevent KEYCODE_WAKEUP", path);
if (wakeywakey.Output.Contains("more than one"))
{
@@ -430,9 +433,9 @@ namespace AndroidSideloader
}
}
if (File.Exists($@"{Path.GetPathRoot(Environment.SystemDirectory)}\RSL\platform-tools\StoredIP.txt") && !Properties.Settings.Default.Wired)
if (File.Exists(Path.Combine(Path.GetPathRoot(Environment.SystemDirectory), "RSL", "platform-tools", "StoredIP.txt")) && !Properties.Settings.Default.Wired)
{
string IPcmndfromtxt = File.ReadAllText($@"{Path.GetPathRoot(Environment.SystemDirectory)}\RSL\platform-tools\StoredIP.txt");
string IPcmndfromtxt = File.ReadAllText(Path.Combine(Path.GetPathRoot(Environment.SystemDirectory), "RSL", "platform-tools", "StoredIP.txt"));
Properties.Settings.Default.IPAddress = IPcmndfromtxt;
Properties.Settings.Default.Save();
ProcessOutput IPoutput = ADB.RunAdbCommandToString(IPcmndfromtxt);
@@ -441,7 +444,7 @@ namespace AndroidSideloader
_ = FlexibleMessageBox.Show(Program.form, "Attempt to connect to saved IP has failed. This is usually due to rebooting the device or not having a STATIC IP set in your router.\nYou must enable Wireless ADB again!");
Properties.Settings.Default.IPAddress = "";
Properties.Settings.Default.Save();
try { File.Delete($"{Path.GetPathRoot(Environment.SystemDirectory)}RSL\\platform-tools\\StoredIP.txt"); }
try { File.Delete(Path.Combine(Path.GetPathRoot(Environment.SystemDirectory), "RSL", "platform-tools", "StoredIP.txt")); }
catch (Exception ex) { Logger.Log($"Unable to delete StoredIP.txt due to {ex.Message}", LogLevel.ERROR); }
}
else
@@ -450,7 +453,7 @@ namespace AndroidSideloader
_ = ADB.RunAdbCommandToString("shell settings put global wifi_wakeup_enabled 1");
}
}
else if (!File.Exists($@"{Path.GetPathRoot(Environment.SystemDirectory)}\RSL\platform-tools\StoredIP.txt"))
else if (!File.Exists(Path.Combine(Path.GetPathRoot(Environment.SystemDirectory), "RSL", "platform-tools", "StoredIP.txt")))
{
Properties.Settings.Default.IPAddress = "";
Properties.Settings.Default.Save();
@@ -1047,131 +1050,154 @@ namespace AndroidSideloader
return;
}
if (!isworking)
string deviceCodeName = ADB.RunAdbCommandToString("shell getprop ro.product.device").Output.ToLower().Trim();
string codeNamesLink = "https://raw.githubusercontent.com/VRPirates/rookie/main/codenames";
bool codenameExists = false;
try
{
isworking = true;
progressBar.Style = ProgressBarStyle.Marquee;
string HWID = SideloaderUtilities.UUID();
string GameName = m_combo.SelectedItem.ToString();
string packageName = Sideloader.gameNameToPackageName(GameName);
string InstalledVersionCode = ADB.RunAdbCommandToString($"shell \"dumpsys package {packageName} | grep versionCode -F\"").Output;
InstalledVersionCode = Utilities.StringUtilities.RemoveEverythingBeforeFirst(InstalledVersionCode, "versionCode=");
InstalledVersionCode = Utilities.StringUtilities.RemoveEverythingAfterFirst(InstalledVersionCode, " ");
ulong VersionInt = ulong.Parse(Utilities.StringUtilities.KeepOnlyNumbers(InstalledVersionCode));
codenameExists = HttpClient.GetStringAsync(codeNamesLink).Result.Contains(deviceCodeName);
}
catch
{
_ = Logger.Log("Unable to download Codenames file.");
FlexibleMessageBox.Show(Program.form, $"Error downloading Codenames File from Github", "Verification Error", MessageBoxButtons.OK);
}
string gameName = $"{GameName} v{VersionInt} {packageName} {HWID.Substring(0, 1)}";
string gameZipName = $"{gameName}.zip";
_ = Logger.Log($"Found Device Code Name: {deviceCodeName}");
_ = Logger.Log($"Identified as Meta Device: {codenameExists}");
// Delete both zip & txt if the files exist, most likely due to a failed upload.
if (File.Exists($"{Properties.Settings.Default.MainDir}\\{gameZipName}"))
if (codenameExists)
{
if (!isworking)
{
File.Delete($"{Properties.Settings.Default.MainDir}\\{gameZipName}");
}
isworking = true;
progressBar.Style = ProgressBarStyle.Marquee;
string HWID = SideloaderUtilities.UUID();
string GameName = m_combo.SelectedItem.ToString();
string packageName = Sideloader.gameNameToPackageName(GameName);
string InstalledVersionCode = ADB.RunAdbCommandToString($"shell \"dumpsys package {packageName} | grep versionCode -F\"").Output;
InstalledVersionCode = Utilities.StringUtilities.RemoveEverythingBeforeFirst(InstalledVersionCode, "versionCode=");
InstalledVersionCode = Utilities.StringUtilities.RemoveEverythingAfterFirst(InstalledVersionCode, " ");
ulong VersionInt = ulong.Parse(Utilities.StringUtilities.KeepOnlyNumbers(InstalledVersionCode));
if (File.Exists($"{Properties.Settings.Default.MainDir}\\{gameName}.txt"))
{
File.Delete($"{Properties.Settings.Default.MainDir}\\{gameName}.txt");
}
string gameName = $"{GameName} v{VersionInt} {packageName} {HWID.Substring(0, 1)} {deviceCodeName}";
string gameZipName = $"{gameName}.zip";
ProcessOutput output = new ProcessOutput("", "");
changeTitle("Extracting APK....");
// Delete both zip & txt if the files exist, most likely due to a failed upload.
if (File.Exists($"{Properties.Settings.Default.MainDir}\\{gameZipName}"))
{
File.Delete($"{Properties.Settings.Default.MainDir}\\{gameZipName}");
}
_ = Directory.CreateDirectory($"{Properties.Settings.Default.MainDir}\\{packageName}");
if (File.Exists($"{Properties.Settings.Default.MainDir}\\{gameName}.txt"))
{
File.Delete($"{Properties.Settings.Default.MainDir}\\{gameName}.txt");
}
Thread t1 = new Thread(() =>
{
output = Sideloader.getApk(GameName);
})
{
IsBackground = true
};
t1.Start();
ProcessOutput output = new ProcessOutput("", "");
changeTitle("Extracting APK....");
while (t1.IsAlive)
{
await Task.Delay(100);
}
_ = Directory.CreateDirectory($"{Properties.Settings.Default.MainDir}\\{packageName}");
changeTitle("Extracting obb if it exists....");
Thread t2 = new Thread(() =>
{
output += ADB.RunAdbCommandToString($"pull \"/sdcard/Android/obb/{packageName}\" \"{Properties.Settings.Default.MainDir}\\{packageName}\"");
})
{
IsBackground = true
};
t2.Start();
Thread t1 = new Thread(() =>
{
output = Sideloader.getApk(GameName);
})
{
IsBackground = true
};
t1.Start();
while (t2.IsAlive)
{
await Task.Delay(100);
}
while (t1.IsAlive)
{
await Task.Delay(100);
}
File.WriteAllText($"{Properties.Settings.Default.MainDir}\\{packageName}\\HWID.txt", HWID);
File.WriteAllText($"{Properties.Settings.Default.MainDir}\\{packageName}\\uploadMethod.txt", "manual");
changeTitle("Zipping extracted application...");
string cmd = $"7z a -mx1 \"{gameZipName}\" .\\{packageName}\\*";
string path = $"{Properties.Settings.Default.MainDir}\\7z.exe";
progressBar.Style = ProgressBarStyle.Continuous;
Thread t4 = new Thread(() =>
{
_ = ADB.RunCommandToString(cmd, path);
})
{
IsBackground = true
};
t4.Start();
while (t4.IsAlive)
{
await Task.Delay(100);
}
changeTitle("Extracting obb if it exists....");
Thread t2 = new Thread(() =>
{
output += ADB.RunAdbCommandToString($"pull \"/sdcard/Android/obb/{packageName}\" \"{Properties.Settings.Default.MainDir}\\{packageName}\"");
})
{
IsBackground = true
};
t2.Start();
while (t2.IsAlive)
{
await Task.Delay(100);
}
File.WriteAllText($"{Properties.Settings.Default.MainDir}\\{packageName}\\HWID.txt", HWID);
File.WriteAllText($"{Properties.Settings.Default.MainDir}\\{packageName}\\uploadMethod.txt", "manual");
changeTitle("Zipping extracted application...");
string cmd = $"7z a -mx1 \"{gameZipName}\" .\\{packageName}\\*";
string path = $"{Properties.Settings.Default.MainDir}\\7z.exe";
progressBar.Style = ProgressBarStyle.Continuous;
Thread t4 = new Thread(() =>
{
_ = ADB.RunCommandToString(cmd, path);
})
{
IsBackground = true
};
t4.Start();
while (t4.IsAlive)
{
await Task.Delay(100);
}
changeTitle("Uploading to server, you can continue to use Rookie while it uploads in the background.");
ULGif.Visible = true;
ULLabel.Visible = true;
ULGif.Enabled = true;
isworking = false;
isuploading = true;
Thread t3 = new Thread(() =>
{
string currentlyUploading = GameName;
changeTitle("Uploading to server, you can continue to use Rookie while it uploads in the background.");
ULGif.Visible = true;
ULLabel.Visible = true;
ULGif.Enabled = true;
isworking = false;
isuploading = true;
Thread t3 = new Thread(() =>
{
string currentlyUploading = GameName;
changeTitle("Uploading to server, you can continue to use Rookie while it uploads in the background.");
// Get size of pending zip upload and write to text file
long zipSize = new FileInfo($"{Properties.Settings.Default.MainDir}\\{gameZipName}").Length;
File.WriteAllText($"{Properties.Settings.Default.MainDir}\\{gameName}.txt", zipSize.ToString());
// Upload size file.
_ = RCLONE.runRcloneCommand_UploadConfig($"copy \"{Properties.Settings.Default.MainDir}\\{gameName}.txt\" RSL-gameuploads:");
// Upload zip.
_ = RCLONE.runRcloneCommand_UploadConfig($"copy \"{Properties.Settings.Default.MainDir}\\{gameZipName}\" RSL-gameuploads:");
// Get size of pending zip upload and write to text file
long zipSize = new FileInfo($"{Properties.Settings.Default.MainDir}\\{gameZipName}").Length;
File.WriteAllText($"{Properties.Settings.Default.MainDir}\\{gameName}.txt", zipSize.ToString());
// Upload size file.
_ = RCLONE.runRcloneCommand_UploadConfig($"copy \"{Properties.Settings.Default.MainDir}\\{gameName}.txt\" RSL-gameuploads:");
// Upload zip.
_ = RCLONE.runRcloneCommand_UploadConfig($"copy \"{Properties.Settings.Default.MainDir}\\{gameZipName}\" RSL-gameuploads:");
// Delete files once uploaded.
File.Delete($"{Properties.Settings.Default.MainDir}\\{gameName}.txt");
File.Delete($"{Properties.Settings.Default.MainDir}\\{gameZipName}");
// Delete files once uploaded.
File.Delete($"{Properties.Settings.Default.MainDir}\\{gameName}.txt");
File.Delete($"{Properties.Settings.Default.MainDir}\\{gameZipName}");
this.Invoke(() => FlexibleMessageBox.Show(Program.form, $"Upload of {currentlyUploading} is complete! Thank you for your contribution!"));
Directory.Delete($"{Properties.Settings.Default.MainDir}\\{packageName}", true);
})
{
IsBackground = true
};
t3.Start();
isuploading = true;
this.Invoke(() => FlexibleMessageBox.Show(Program.form, $"Upload of {currentlyUploading} is complete! Thank you for your contribution!"));
Directory.Delete($"{Properties.Settings.Default.MainDir}\\{packageName}", true);
})
{
IsBackground = true
};
t3.Start();
isuploading = true;
while (t3.IsAlive)
{
await Task.Delay(100);
while (t3.IsAlive)
{
await Task.Delay(100);
}
changeTitle(" \n\n");
isuploading = false;
ULGif.Visible = false;
ULLabel.Visible = false;
ULGif.Enabled = false;
}
else
{
_ = MessageBox.Show("You must wait until each app is finished uploading to start another.");
}
changeTitle(" \n\n");
isuploading = false;
ULGif.Visible = false;
ULLabel.Visible = false;
ULGif.Enabled = false;
}
else
{
_ = MessageBox.Show("You must wait until each app is finished uploading to start another.");
FlexibleMessageBox.Show(Program.form, $"You are attempting to upload from an unknown device, please connect a Meta Quest device to upload", "Unknown Device", MessageBoxButtons.OK);
}
}
@@ -1524,9 +1550,9 @@ namespace AndroidSideloader
string foldername = filename.Substring(filename.IndexOf('.') + 1);
foldername = foldername.Substring(foldername.IndexOf('.') + 1);
foldername = foldername.Replace(".obb", "");
foldername = Environment.CurrentDirectory + "\\" + foldername;
foldername = Path.Combine(Environment.CurrentDirectory, foldername);
_ = Directory.CreateDirectory(foldername);
File.Copy(data, foldername + "\\" + filename);
File.Copy(data, Path.Combine(foldername, filename));
path = foldername;
Thread t1 = new Thread(() =>
@@ -1734,7 +1760,8 @@ namespace AndroidSideloader
}
}
}
if (installedVersionInt == cloudVersionInt) {
if (installedVersionInt == cloudVersionInt)
{
upToDateCount++;
}
//ulong cloudVersionInt = ulong.Parse(Utilities.StringUtilities.KeepOnlyNumbers(release[SideloaderRCLONE.VersionCodeIndex]));
@@ -1917,19 +1944,19 @@ namespace AndroidSideloader
string apppath = ADB.RunAdbCommandToString($"shell pm path {newGamesToUpload}").Output;
apppath = Utilities.StringUtilities.RemoveEverythingBeforeFirst(apppath, "/");
apppath = Utilities.StringUtilities.RemoveEverythingAfterFirst(apppath, "\r\n");
if (File.Exists($"{Path.GetPathRoot(Environment.SystemDirectory)}RSL\\platform-tools\\base.apk"))
if (File.Exists(Path.Combine(Path.GetPathRoot(Environment.SystemDirectory), "RSL", "platform-tools", "base.apk")))
{
File.Delete($"{Path.GetPathRoot(Environment.SystemDirectory)}RSL\\platform-tools\\base.apk");
File.Delete(Path.Combine(Path.GetPathRoot(Environment.SystemDirectory), "RSL", "platform-tools", "base.apk"));
}
_ = ADB.RunAdbCommandToString($"pull \"{apppath}\"");
string cmd = $"\"{Path.GetPathRoot(Environment.SystemDirectory)}RSL\\platform-tools\\aapt.exe\" dump badging \"{Path.GetPathRoot(Environment.SystemDirectory)}RSL\\platform-tools\\base.apk\" | findstr -i \"application-label\"";
string workingpath = $"{Path.GetPathRoot(Environment.SystemDirectory)}RSL\\platform-tools\\aapt.exe";
string workingpath = Path.Combine(Path.GetPathRoot(Environment.SystemDirectory), "RSL", "platform-tools", "aapt.exe");
string ReleaseName = ADB.RunCommandToString(cmd, workingpath).Output;
ReleaseName = Utilities.StringUtilities.RemoveEverythingBeforeFirst(ReleaseName, "'");
ReleaseName = Utilities.StringUtilities.RemoveEverythingAfterFirst(ReleaseName, "\r\n");
ReleaseName = ReleaseName.Replace("'", "");
File.Delete($"{Path.GetPathRoot(Environment.SystemDirectory)}RSL\\platform-tools\\base.apk");
File.Delete(Path.Combine(Path.GetPathRoot(Environment.SystemDirectory), "RSL", "platform-tools", "base.apk"));
if (ReleaseName.Contains("Microsoft Windows"))
{
ReleaseName = RlsName;
@@ -1984,6 +2011,7 @@ namespace AndroidSideloader
loaded = true;
}
private static readonly HttpClient HttpClient = new HttpClient();
public static async void doUpload()
{
Program.form.changeTitle("Uploading to server, you can continue to use Rookie while it uploads in the background.");
@@ -1991,79 +2019,90 @@ namespace AndroidSideloader
Program.form.ULLabel.Visible = true;
Program.form.ULGif.Enabled = true;
isworking = true;
string deviceCodeName = ADB.RunAdbCommandToString("shell getprop ro.product.device").Output.ToLower();
string codeNamesLink = "https://raw.githubusercontent.com/VRPirates/rookie/main/codenames";
bool codenameExists = HttpClient.GetStringAsync(codeNamesLink).Result.Contains(deviceCodeName);
foreach (UploadGame game in Program.form.gamesToUpload)
if (codenameExists)
{
Thread t3 = new Thread(() =>
foreach (UploadGame game in Program.form.gamesToUpload)
{
string packagename = game.Pckgcommand;
string gameName = $"{game.Uploadgamename} v{game.Uploadversion} {game.Pckgcommand} {SideloaderUtilities.UUID().Substring(0, 1)}";
string gameZipName = $"{gameName}.zip";
// Delete both zip & txt if the files exist, most likely due to a failed upload.
if (File.Exists($"{Properties.Settings.Default.MainDir}\\{gameZipName}"))
Thread t3 = new Thread(() =>
{
File.Delete($"{Properties.Settings.Default.MainDir}\\{gameZipName}");
}
string packagename = game.Pckgcommand;
string gameName = $"{game.Uploadgamename} v{game.Uploadversion} {game.Pckgcommand} {SideloaderUtilities.UUID().Substring(0, 1)} {deviceCodeName}";
string gameZipName = $"{gameName}.zip";
if (File.Exists($"{Properties.Settings.Default.MainDir}\\{gameName}.txt"))
// Delete both zip & txt if the files exist, most likely due to a failed upload.
if (File.Exists($"{Properties.Settings.Default.MainDir}\\{gameZipName}"))
{
File.Delete($"{Properties.Settings.Default.MainDir}\\{gameZipName}");
}
if (File.Exists($"{Properties.Settings.Default.MainDir}\\{gameName}.txt"))
{
File.Delete($"{Properties.Settings.Default.MainDir}\\{gameName}.txt");
}
string path = $"{Properties.Settings.Default.MainDir}\\7z.exe";
string cmd = $"7z a -mx1 \"{Properties.Settings.Default.MainDir}\\{gameZipName}\" .\\{game.Pckgcommand}\\*";
Program.form.changeTitle("Zipping extracted application...");
_ = ADB.RunCommandToString(cmd, path);
if (Directory.Exists($"{Properties.Settings.Default.MainDir}\\{game.Pckgcommand}"))
{
Directory.Delete($"{Properties.Settings.Default.MainDir}\\{game.Pckgcommand}", true);
}
Program.form.changeTitle("Uploading to server, you may continue to use Rookie while it uploads.");
// Get size of pending zip upload and write to text file
long zipSize = new FileInfo($"{Properties.Settings.Default.MainDir}\\{gameZipName}").Length;
File.WriteAllText($"{Properties.Settings.Default.MainDir}\\{gameName}.txt", zipSize.ToString());
// Upload size file.
_ = RCLONE.runRcloneCommand_UploadConfig($"copy \"{Properties.Settings.Default.MainDir}\\{gameName}.txt\" RSL-gameuploads:");
// Upload zip.
_ = RCLONE.runRcloneCommand_UploadConfig($"copy \"{Properties.Settings.Default.MainDir}\\{gameZipName}\" RSL-gameuploads:");
if (game.isUpdate)
{
Properties.Settings.Default.SubmittedUpdates += game.Pckgcommand + "\n";
Properties.Settings.Default.Save();
}
// Delete files once uploaded.
if (File.Exists($"{Properties.Settings.Default.MainDir}\\{gameName}.txt"))
{
File.Delete($"{Properties.Settings.Default.MainDir}\\{gameName}.txt");
}
if (File.Exists($"{Properties.Settings.Default.MainDir}\\{gameZipName}"))
{
File.Delete($"{Properties.Settings.Default.MainDir}\\{gameZipName}");
}
})
{
File.Delete($"{Properties.Settings.Default.MainDir}\\{gameName}.txt");
}
string path = $"{Properties.Settings.Default.MainDir}\\7z.exe";
string cmd = $"7z a -mx1 \"{Properties.Settings.Default.MainDir}\\{gameZipName}\" .\\{game.Pckgcommand}\\*";
Program.form.changeTitle("Zipping extracted application...");
_ = ADB.RunCommandToString(cmd, path);
if (Directory.Exists($"{Properties.Settings.Default.MainDir}\\{game.Pckgcommand}"))
IsBackground = true
};
t3.Start();
while (t3.IsAlive)
{
Directory.Delete($"{Properties.Settings.Default.MainDir}\\{game.Pckgcommand}", true);
isuploading = true;
await Task.Delay(100);
}
Program.form.changeTitle("Uploading to server, you may continue to use Rookie while it uploads.");
// Get size of pending zip upload and write to text file
long zipSize = new FileInfo($"{Properties.Settings.Default.MainDir}\\{gameZipName}").Length;
File.WriteAllText($"{Properties.Settings.Default.MainDir}\\{gameName}.txt", zipSize.ToString());
// Upload size file.
_ = RCLONE.runRcloneCommand_UploadConfig($"copy \"{Properties.Settings.Default.MainDir}\\{gameName}.txt\" RSL-gameuploads:");
// Upload zip.
_ = RCLONE.runRcloneCommand_UploadConfig($"copy \"{Properties.Settings.Default.MainDir}\\{gameZipName}\" RSL-gameuploads:");
if (game.isUpdate)
{
Properties.Settings.Default.SubmittedUpdates += game.Pckgcommand + "\n";
Properties.Settings.Default.Save();
}
// Delete files once uploaded.
if (File.Exists($"{Properties.Settings.Default.MainDir}\\{gameName}.txt"))
{
File.Delete($"{Properties.Settings.Default.MainDir}\\{gameName}.txt");
}
if (File.Exists($"{Properties.Settings.Default.MainDir}\\{gameZipName}"))
{
File.Delete($"{Properties.Settings.Default.MainDir}\\{gameZipName}");
}
})
{
IsBackground = true
};
t3.Start();
while (t3.IsAlive)
{
isuploading = true;
await Task.Delay(100);
}
Program.form.gamesToUpload.Clear();
isworking = false;
isuploading = false;
Program.form.ULGif.Visible = false;
Program.form.ULLabel.Visible = false;
Program.form.ULGif.Enabled = false;
Program.form.changeTitle(" \n\n");
}
else
{
FlexibleMessageBox.Show(Program.form, $"You are attempting to upload from an unknown device, please connect a Meta Quest device to upload", "Unknown Device", MessageBoxButtons.OK);
}
Program.form.gamesToUpload.Clear();
isworking = false;
isuploading = false;
Program.form.ULGif.Visible = false;
Program.form.ULLabel.Visible = false;
Program.form.ULGif.Enabled = false;
Program.form.changeTitle(" \n\n");
}
public static async void newPackageUpload()
@@ -2283,7 +2322,7 @@ namespace AndroidSideloader
Properties.Settings.Default.Save();
try
{
File.WriteAllText($"{Path.GetPathRoot(Environment.SystemDirectory)}RSL\\platform-tools\\StoredIP.txt", IPcmnd);
File.WriteAllText(Path.Combine(Path.GetPathRoot(Environment.SystemDirectory), "RSL", "platform-tools", "StoredIP.txt"), IPcmnd);
}
catch (Exception ex) { Logger.Log($"Unable to write to StoredIP.txt due to {ex.Message}", LogLevel.ERROR); }
ADB.wirelessadbON = true;
@@ -2405,7 +2444,7 @@ First time launching Rookie? Please relaunch and try again.
Things you can try:
1) Move the Rookie directory (Folder containing AndroidSideloader.exe) into {Path.GetPathRoot(Environment.SystemDirectory)}RSL
2) Try changing your systems DNS to either Cloudflare/Google/OpenDNS
3) Try using a systemwide VPN like ProtonVPN
3) Try using a systemwide VPN like ProtonVPN (which is free)
4) Sponsor a private server (https://vrpirates.wiki/en/Howto/sponsored-mirrors)
";
@@ -2505,7 +2544,7 @@ Things you can try:
gameName = gamesQueueList.ToArray()[0];
string packagename = Sideloader.gameNameToPackageName(gameName);
string dir = Path.GetDirectoryName(gameName);
string gameDirectory = Properties.Settings.Default.downloadDir + "\\" + gameName;
string gameDirectory = Path.Combine(Properties.Settings.Default.downloadDir, gameName);
string path = gameDirectory;
string gameNameHash = string.Empty;
@@ -2695,46 +2734,46 @@ Things you can try:
if (hasPublicConfig && otherError == false && gameDownloadOutput.Output != "Download skipped.")
{
Thread extractionThread = new Thread(() =>
Thread extractionThread = new Thread(() =>
{
Invoke(new Action(() =>
{
speedLabel.Text = "Extracting..."; etaLabel.Text = "Please wait...";
progressBar.Style = ProgressBarStyle.Continuous;
progressBar.Value = 0;
isInDownloadExtract = true;
}));
try
{
changeTitle("Extracting " + gameName, false);
Zip.ExtractFile($"{Properties.Settings.Default.downloadDir}\\{gameNameHash}\\{gameNameHash}.7z.001", $"{Properties.Settings.Default.downloadDir}", PublicConfigFile.Password);
Program.form.changeTitle("");
}
catch (ExtractionException ex)
{
Invoke(new Action(() =>
{
speedLabel.Text = "Extracting..."; etaLabel.Text = "Please wait...";
progressBar.Style = ProgressBarStyle.Continuous;
progressBar.Value = 0;
isInDownloadExtract = true;
cleanupActiveDownloadStatus();
}));
try
{
changeTitle("Extracting " + gameName, false);
Zip.ExtractFile($"{Properties.Settings.Default.downloadDir}\\{gameNameHash}\\{gameNameHash}.7z.001", $"{Properties.Settings.Default.downloadDir}", PublicConfigFile.Password);
Program.form.changeTitle("");
}
catch (Exception ex)
{
Invoke(new Action(() =>
{
cleanupActiveDownloadStatus();
}));
otherError = true;
this.Invoke(() => _ = FlexibleMessageBox.Show(Program.form, $"7zip error: {ex.Message}"));
output += new ProcessOutput("", "Extract Failed");
}
})
{
IsBackground = true
};
extractionThread.Start();
while (extractionThread.IsAlive)
{
await Task.Delay(100);
otherError = true;
this.Invoke(() => _ = FlexibleMessageBox.Show(Program.form, $"7zip error: {ex.Message}"));
output += new ProcessOutput("", "Extract Failed");
}
})
{
IsBackground = true
};
extractionThread.Start();
if (Directory.Exists($"{Properties.Settings.Default.downloadDir}\\{gameNameHash}"))
{
Directory.Delete($"{Properties.Settings.Default.downloadDir}\\{gameNameHash}", true);
}
while (extractionThread.IsAlive)
{
await Task.Delay(100);
}
if (Directory.Exists($"{Properties.Settings.Default.downloadDir}\\{gameNameHash}"))
{
Directory.Delete($"{Properties.Settings.Default.downloadDir}\\{gameNameHash}", true);
}
}
if (quotaError == false && otherError == false)
@@ -2764,86 +2803,86 @@ Things you can try:
if (isinstalltxt)
{
if (!Properties.Settings.Default.nodevicemode || !nodeviceonstart && DeviceConnected)
{
Thread installtxtThread = new Thread(() =>
{
output += Sideloader.RunADBCommandsFromFile(installTxtPath);
changeTitle(" \n\n");
});
installtxtThread.Start();
while (installtxtThread.IsAlive)
{
await Task.Delay(100);
}
}
else
{
Thread installtxtThread = new Thread(() =>
{
output.Output = "\n--- NO DEVICE MODE ---\nAll tasks finished.\n--- NO DEVICE MODE --";
output += Sideloader.RunADBCommandsFromFile(installTxtPath);
changeTitle(" \n\n");
});
installtxtThread.Start();
while (installtxtThread.IsAlive)
{
await Task.Delay(100);
}
}
else
else
{
output.Output = "\n--- NO DEVICE MODE ---\nAll tasks finished.\n--- NO DEVICE MODE --";
}
}
else
{
if (!Properties.Settings.Default.nodevicemode || !nodeviceonstart && DeviceConnected)
{
{
// Find the APK file to install
string apkFile = files.FirstOrDefault(file => Path.GetExtension(file) == ".apk");
if (apkFile != null)
{
{
CurrAPK = apkFile;
CurrPCKG = packagename;
System.Windows.Forms.Timer t = new System.Windows.Forms.Timer
{
Interval = 150000 // 150 seconds to fail
};
t.Tick += new EventHandler(timer_Tick4);
t.Start();
Thread apkThread = new Thread(() =>
{
Program.form.changeTitle($"Sideloading apk...");
CurrPCKG = packagename;
System.Windows.Forms.Timer t = new System.Windows.Forms.Timer
{
Interval = 150000 // 150 seconds to fail
};
t.Tick += new EventHandler(timer_Tick4);
t.Start();
Thread apkThread = new Thread(() =>
{
Program.form.changeTitle($"Sideloading apk...");
output += ADB.Sideload(apkFile, packagename);
})
{
IsBackground = true
};
apkThread.Start();
while (apkThread.IsAlive)
{
await Task.Delay(100);
}
t.Stop();
})
{
IsBackground = true
};
apkThread.Start();
while (apkThread.IsAlive)
{
await Task.Delay(100);
}
t.Stop();
Debug.WriteLine(wrDelimiter);
if (Directory.Exists($"{Properties.Settings.Default.downloadDir}\\{gameName}\\{packagename}"))
{
deleteOBB(packagename);
Thread obbThread = new Thread(() =>
{
changeTitle($"Copying {packagename} obb to device...");
deleteOBB(packagename);
Thread obbThread = new Thread(() =>
{
changeTitle($"Copying {packagename} obb to device...");
ADB.RunAdbCommandToString($"shell mkdir /sdcard/Android/obb/{packagename}");
output += ADB.RunAdbCommandToString($"push \"{Properties.Settings.Default.downloadDir}\\{gameName}\\{packagename}\" \"/sdcard/Android/obb\"");
Program.form.changeTitle("");
})
Program.form.changeTitle("");
})
{
IsBackground = true
};
obbThread.Start();
while (obbThread.IsAlive)
{
await Task.Delay(100);
}
if (!nodeviceonstart | DeviceConnected)
{
if (!output.Output.Contains("offline"))
{
IsBackground = true
};
obbThread.Start();
while (obbThread.IsAlive)
{
await Task.Delay(100);
}
if (!nodeviceonstart | DeviceConnected)
{
if (!output.Output.Contains("offline"))
try
{
try
{
obbsMismatch = await compareOBBSizes(packagename, gameName, output);
}
catch (Exception ex) { _ = FlexibleMessageBox.Show(Program.form, $"Error comparing OBB sizes: {ex.Message}"); }
obbsMismatch = await compareOBBSizes(packagename, gameName, output);
}
catch (Exception ex) { _ = FlexibleMessageBox.Show(Program.form, $"Error comparing OBB sizes: {ex.Message}"); }
}
}
}
}
}
else
@@ -3068,9 +3107,9 @@ Things you can try:
_ = ADB.RunAdbCommandToString($"push \"{Environment.CurrentDirectory}\\{CurrPCKG}\" /sdcard/Android/data/");
timerticked = false;
if (Directory.Exists($"{Environment.CurrentDirectory}\\{CurrPCKG}"))
if (Directory.Exists(Path.Combine(Environment.CurrentDirectory, CurrPCKG)))
{
Directory.Delete($"{Environment.CurrentDirectory}\\{CurrPCKG}", true);
Directory.Delete(Path.Combine(Environment.CurrentDirectory, CurrPCKG), true);
}
changeTitle(" \n\n");
@@ -3163,9 +3202,9 @@ Things you can try:
_ = Program.form.GetDeviceID();
Program.form.changeTitlebarToDevice();
_ = FlexibleMessageBox.Show(Program.form, "Relaunch Rookie to complete the process and switch back to USB adb.");
if (File.Exists($"{Path.GetPathRoot(Environment.SystemDirectory)}RSL\\platform-tools\\StoredIP.txt"))
if (File.Exists(Path.Combine(Path.GetPathRoot(Environment.SystemDirectory), "RSL", "platform-tools", "StoredIP.txt")))
{
File.Delete($"{Path.GetPathRoot(Environment.SystemDirectory)}RSL\\platform-tools\\StoredIP.txt");
File.Delete(Path.Combine(Path.GetPathRoot(Environment.SystemDirectory), "RSL", "platform-tools", "StoredIP.txt"));
}
}
}
@@ -3403,7 +3442,8 @@ Things you can try:
try
{
var matches = _allItems
.Where(i => i.Text.IndexOf(searchTerm, StringComparison.CurrentCultureIgnoreCase) >= 0)
.Where(i => i.Text.IndexOf(searchTerm, StringComparison.CurrentCultureIgnoreCase) >= 0
|| i.SubItems[1].Text.IndexOf(searchTerm, StringComparison.CurrentCultureIgnoreCase) >= 0)
.ToList();
gamesListView.BeginUpdate(); // Improve UI performance
@@ -3473,7 +3513,7 @@ Things you can try:
private async Task CreateEnvironment()
{
string appDataLocation = $@"{Path.GetPathRoot(Environment.SystemDirectory)}\RSL\";
string appDataLocation = Path.Combine(Path.GetPathRoot(Environment.SystemDirectory), "RSL");
var webView2Environment = await CoreWebView2Environment.CreateAsync(userDataFolder: appDataLocation);
await webView21.EnsureCoreWebView2Async(webView2Environment);
}
@@ -3546,7 +3586,7 @@ Things you can try:
else
{
webView21.Enabled = true;
if (!Directory.Exists(Environment.CurrentDirectory + "\\runtimes"))
if (!Directory.Exists(Path.Combine(Environment.CurrentDirectory, "runtimes")))
{
WebClient client = new WebClient();
ServicePointManager.Expect100Continue = true;
@@ -3554,7 +3594,7 @@ Things you can try:
try
{
client.DownloadFile("https://vrpirates.wiki/downloads/runtimes.7z", "runtimes.7z");
Utilities.Zip.ExtractFile(Environment.CurrentDirectory + "\\runtimes.7z", Environment.CurrentDirectory);
Utilities.Zip.ExtractFile(Path.Combine(Environment.CurrentDirectory, "runtimes.7z"), Environment.CurrentDirectory);
File.Delete("runtimes.7z");
}
catch (Exception ex)
@@ -3816,7 +3856,7 @@ Things you can try:
Program.form.showAvailableSpace();
Properties.Settings.Default.IPAddress = IPcmnd;
Properties.Settings.Default.Save();
try { File.WriteAllText($"{Path.GetPathRoot(Environment.SystemDirectory)}RSL\\platform-tools\\StoredIP.txt", IPcmnd); }
try { File.WriteAllText(Path.Combine(Path.GetPathRoot(Environment.SystemDirectory), "RSL", "platform-tools", "StoredIP.txt"), IPcmnd); }
catch (Exception ex) { Logger.Log($"Unable to write to StoredIP.txt due to {ex.Message}", LogLevel.ERROR); }
ADB.wirelessadbON = true;
_ = ADB.RunAdbCommandToString("shell settings put global wifi_wakeup_available 1");
@@ -4254,7 +4294,8 @@ Things you can try:
lblNeedsDonate.Click += lblNeedsDonate_Click;
}
public static void OpenDirectory(string directoryPath) {
public static void OpenDirectory(string directoryPath)
{
if (Directory.Exists(directoryPath))
{
ProcessStartInfo p = new ProcessStartInfo
@@ -4292,13 +4333,16 @@ Things you can try:
{
bool currentStatus = Properties.Settings.Default.nodevicemode || false;
if (currentStatus) {
if (currentStatus)
{
// No Device Mode is currently On. Toggle it Off
Properties.Settings.Default.nodevicemode = false;
btnNoDevice.Text = "Disable Sideloading";
changeTitle($"Sideloading has been Enabled");
} else {
}
else
{
Properties.Settings.Default.nodevicemode = true;
Properties.Settings.Default.deleteAllAfterInstall = false;
btnNoDevice.Text = "Enable Sideloading";

View File

@@ -138,7 +138,7 @@ namespace AndroidSideloader
_ = Directory.CreateDirectory($"{path}\\Quest Recordings");
}
_ = MessageBox.Show("Please wait until you get the message that the transfer has finished.");;
_ = MessageBox.Show("Please wait until you get the message that the transfer has finished.");
Program.form.changeTitle("Pulling files...");
_ = ADB.RunAdbCommandToString($"pull \"/sdcard/Oculus/Videoshots\" \"{path}\\Quest Recordings\"");
if (delsh)

View File

@@ -94,12 +94,12 @@ namespace AndroidSideloader
_ = Logger.Log($"Running Rclone command: {logcmd}");
rclone.StartInfo.FileName = Environment.CurrentDirectory + "\\rclone\\rclone.exe";
rclone.StartInfo.FileName = Path.Combine(Environment.CurrentDirectory, "rclone", "rclone.exe");
rclone.StartInfo.Arguments = command;
rclone.StartInfo.RedirectStandardInput = true;
rclone.StartInfo.RedirectStandardError = true;
rclone.StartInfo.RedirectStandardOutput = true;
rclone.StartInfo.WorkingDirectory = Environment.CurrentDirectory + "\\rclone";
rclone.StartInfo.WorkingDirectory = Path.Combine(Environment.CurrentDirectory, "rclone");
rclone.StartInfo.CreateNoWindow = true;
// Display RCLONE Window if the binary is being run in Debug Mode.
if (MainForm.debugMode)
@@ -118,10 +118,13 @@ namespace AndroidSideloader
if (error.Contains("There is not enough space"))
{
_ = FlexibleMessageBox.Show(Program.form, $"There isn't enough disk space to download this game.\r\nPlease ensure you have at least 200MB more the game size available in {Environment.CurrentDirectory} and try again.",
Program.form.Invoke(() =>
{
_ = FlexibleMessageBox.Show(Program.form, $"There isn't enough disk space to download this game.\r\nPlease ensure you have at least 200MB more the game size available in {Properties.Settings.Default.downloadDir} and try again.",
"NOT ENOUGH SPACE",
MessageBoxButtons.OK,
MessageBoxIcon.Error);
});
return new ProcessOutput("Download failed.", "");
}
@@ -150,7 +153,7 @@ namespace AndroidSideloader
{
if (!string.IsNullOrWhiteSpace(error))
{
_ = Logger.Log($"Rclone error: {error}\n", LogLevel.ERROR);
_ = Logger.Log($"Rclone error: {error}\n", LogLevel.ERROR);
}
if (!string.IsNullOrWhiteSpace(output))
@@ -188,12 +191,12 @@ namespace AndroidSideloader
command += " --checkers 0 --no-check-dest --retries 1";
rclone.StartInfo.FileName = Environment.CurrentDirectory + "\\rclone\\rclone.exe";
rclone.StartInfo.FileName = Path.Combine(Environment.CurrentDirectory, "rclone", "rclone.exe");
rclone.StartInfo.Arguments = command;
rclone.StartInfo.RedirectStandardInput = true;
rclone.StartInfo.RedirectStandardError = true;
rclone.StartInfo.RedirectStandardOutput = true;
rclone.StartInfo.WorkingDirectory = Environment.CurrentDirectory + "\\rclone";
rclone.StartInfo.WorkingDirectory = Path.Combine(Environment.CurrentDirectory, "rclone");
rclone.StartInfo.CreateNoWindow = true;
// Display RCLONE Window if the binary is being run in Debug Mode.
if (MainForm.debugMode)
@@ -263,13 +266,13 @@ namespace AndroidSideloader
//set http source & args
command += $" --http-url {MainForm.PublicConfigFile.BaseUri} {MainForm.PublicMirrorExtraArgs}";
rclone.StartInfo.FileName = Environment.CurrentDirectory + "\\rclone\\rclone.exe";
rclone.StartInfo.FileName = Path.Combine(Environment.CurrentDirectory, "rclone", "rclone.exe");
rclone.StartInfo.Arguments = command;
rclone.StartInfo.RedirectStandardInput = true;
rclone.StartInfo.RedirectStandardError = true;
rclone.StartInfo.RedirectStandardOutput = true;
rclone.StartInfo.WorkingDirectory = Environment.CurrentDirectory + "\\rclone";
rclone.StartInfo.WorkingDirectory = Path.Combine(Environment.CurrentDirectory, "rclone");
rclone.StartInfo.CreateNoWindow = true;
// Display RCLONE Window if the binary is being run in Debug Mode.
if (MainForm.debugMode)
@@ -288,18 +291,21 @@ namespace AndroidSideloader
if (error.Contains("There is not enough space"))
{
_ = FlexibleMessageBox.Show(Program.form, $"There isn't enough disk space to download this game.\r\nPlease ensure you have at least 2x the game size available in {Environment.CurrentDirectory} and try again.",
Program.form.Invoke(() =>
{
_ = FlexibleMessageBox.Show(Program.form, $"There isn't enough disk space to download this game.\r\nPlease ensure you have at least 2x the game size available in {Properties.Settings.Default.downloadDir} and try again.",
"NOT ENOUGH SPACE",
MessageBoxButtons.OK,
MessageBoxIcon.Error);
});
return new ProcessOutput("Download failed.", string.Empty);
}
if (error.Contains("Only one usage of each socket address (protocol/network address/port) is normally permitted")) {
if (error.Contains("Only one usage of each socket address (protocol/network address/port) is normally permitted"))
{
_ = Logger.Log(error, LogLevel.ERROR);
return new ProcessOutput("Failed to fetch from public mirror.", "Failed to fetch from public mirror.\nYou may have a running RCLONE Task!\nCheck your Task Manager, Sort by Network Usage, and kill the process Rsync for Cloud Storage/Rclone");
}
else if (error.Contains("400 Bad Request")
|| error.Contains("cannot fetch token")
|| error.Contains("authError")

View File

@@ -316,12 +316,12 @@ namespace AndroidSideloader
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/adb2.zip", "_adb.7z");
Utilities.Zip.ExtractFile(Environment.CurrentDirectory + "\\_adb.7z", $"{Path.GetPathRoot(Environment.SystemDirectory)}RSL\\platform-tools");
Utilities.Zip.ExtractFile(Path.Combine(Environment.CurrentDirectory, "_adb.7z"), $"{Path.GetPathRoot(Environment.SystemDirectory)}RSL\\platform-tools");
File.Delete("_adb.7z");
_ = Logger.Log($"adb download successful");
}
if (!Directory.Exists(Environment.CurrentDirectory + "\\rclone"))
if (!Directory.Exists(Path.Combine(Environment.CurrentDirectory, "rclone")))
{
currentAccessedWebsite = "rclone";
_ = Logger.Log($"Missing rclone. Attempting to download from {currentAccessedWebsite}.org");
@@ -335,7 +335,7 @@ namespace AndroidSideloader
_ = Logger.Log("Complete download rclone");
_ = Logger.Log($"Extract {Environment.CurrentDirectory}\\rclone.zip");
Utilities.Zip.ExtractFile(Environment.CurrentDirectory + "\\rclone.zip", Environment.CurrentDirectory);
Utilities.Zip.ExtractFile(Path.Combine(Environment.CurrentDirectory, "rclone.zip"), Environment.CurrentDirectory);
File.Delete("rclone.zip");

View File

@@ -1,4 +1,5 @@
using AndroidSideloader.Utilities;
using Newtonsoft.Json.Linq;
using System;
using System.Collections.Generic;
using System.IO;
@@ -41,9 +42,9 @@ namespace AndroidSideloader
*/
public static List<string[]> games = new List<string[]>();
public static string Nouns = Environment.CurrentDirectory + "\\nouns";
public static string ThumbnailsFolder = Environment.CurrentDirectory + "\\thumbnails";
public static string NotesFolder = Environment.CurrentDirectory + "\\notes";
public static string Nouns = Path.Combine(Environment.CurrentDirectory, "nouns");
public static string ThumbnailsFolder = Path.Combine(Environment.CurrentDirectory, "thumbnails");
public static string NotesFolder = Path.Combine(Environment.CurrentDirectory, "notes");
public static void UpdateNouns(string remote)
{
@@ -76,7 +77,7 @@ namespace AndroidSideloader
try
{
_ = Logger.Log($"Extracting Metadata");
Zip.ExtractFile($"{Environment.CurrentDirectory}\\meta.7z", $"{Environment.CurrentDirectory}\\meta",
Zip.ExtractFile(Path.Combine(Environment.CurrentDirectory, "meta.7z"), Path.Combine(Environment.CurrentDirectory, "meta"),
MainForm.PublicConfigFile.Password);
_ = Logger.Log($"Updating Metadata");
@@ -96,12 +97,12 @@ namespace AndroidSideloader
Directory.Delete(NotesFolder, true);
}
Directory.Move($"{Environment.CurrentDirectory}\\meta\\.meta\\nouns", Nouns);
Directory.Move($"{Environment.CurrentDirectory}\\meta\\.meta\\thumbnails", ThumbnailsFolder);
Directory.Move($"{Environment.CurrentDirectory}\\meta\\.meta\\notes", NotesFolder);
Directory.Move(Path.Combine(Environment.CurrentDirectory, "meta", ".meta", "nouns"), Nouns);
Directory.Move(Path.Combine(Environment.CurrentDirectory, "meta", ".meta", "thumbnails"), ThumbnailsFolder);
Directory.Move(Path.Combine(Environment.CurrentDirectory, "meta", ".meta", "notes"), NotesFolder);
_ = Logger.Log($"Initializing Games List");
string gameList = File.ReadAllText($"{Environment.CurrentDirectory}\\meta\\VRP-GameList.txt");
string gameList = File.ReadAllText(Path.Combine(Environment.CurrentDirectory, "meta", "VRP-GameList.txt"));
string[] splitList = gameList.Split('\n');
splitList = splitList.Skip(1).ToArray();
@@ -114,7 +115,7 @@ namespace AndroidSideloader
}
}
Directory.Delete($"{Environment.CurrentDirectory}\\meta", true);
Directory.Delete(Path.Combine(Environment.CurrentDirectory, "meta"), true);
}
catch (Exception e)
{
@@ -188,23 +189,23 @@ namespace AndroidSideloader
_ = Logger.Log($"Retrieved updated config from: {configUrl}");
if (File.Exists(Environment.CurrentDirectory + "\\rclone\\vrp.download.config_new"))
if (File.Exists(Path.Combine(Environment.CurrentDirectory, "rclone", "vrp.download.config_new")))
{
File.Delete(Environment.CurrentDirectory + "\\rclone\\vrp.download.config_new");
File.Delete(Path.Combine(Environment.CurrentDirectory, "rclone", "vrp.download.config_new"));
}
File.Create(Environment.CurrentDirectory + "\\rclone\\vrp.download.config_new").Close();
File.WriteAllText(Environment.CurrentDirectory + "\\rclone\\vrp.download.config_new", resultString);
File.Create(Path.Combine(Environment.CurrentDirectory, "rclone", "vrp.download.config_new")).Close();
File.WriteAllText(Path.Combine(Environment.CurrentDirectory, "rclone", "vrp.download.config_new"), resultString);
if (!File.Exists(Environment.CurrentDirectory + "\\rclone\\hash.txt"))
if (!File.Exists(Path.Combine(Environment.CurrentDirectory, "rclone", "hash.txt")))
{
File.Create(Environment.CurrentDirectory + "\\rclone\\hash.txt").Close();
File.Create(Path.Combine(Environment.CurrentDirectory, "rclone", "hash.txt")).Close();
}
string newConfig = CalculateMD5(Environment.CurrentDirectory + "\\rclone\\vrp.download.config_new");
string oldConfig = File.ReadAllText(Environment.CurrentDirectory + "\\rclone\\hash.txt");
string newConfig = CalculateMD5(Path.Combine(Environment.CurrentDirectory, "rclone", "vrp.download.config_new"));
string oldConfig = File.ReadAllText(Path.Combine(Environment.CurrentDirectory, "rclone", "hash.txt"));
if (!File.Exists(Environment.CurrentDirectory + "\\rclone\\vrp.download.config"))
if (!File.Exists(Path.Combine(Environment.CurrentDirectory, "rclone", "vrp.download.config")))
{
oldConfig = "Config Doesnt Exist!";
}
@@ -215,23 +216,23 @@ namespace AndroidSideloader
{
_ = Logger.Log($"Updated Config Hash is different than the current Config. Updating Configuration File.");
if (File.Exists(Environment.CurrentDirectory + "\\rclone\\vrp.download.config"))
if (File.Exists(Path.Combine(Environment.CurrentDirectory, "rclone", "vrp.download.config")))
{
File.Delete(Environment.CurrentDirectory + "\\rclone\\vrp.download.config");
File.Delete(Path.Combine(Environment.CurrentDirectory, "rclone", "vrp.download.config"));
}
File.Move(Environment.CurrentDirectory + "\\rclone\\vrp.download.config_new", Environment.CurrentDirectory + "\\rclone\\vrp.download.config");
File.Move(Path.Combine(Environment.CurrentDirectory, "rclone", "vrp.download.config_new"), Path.Combine(Environment.CurrentDirectory, "rclone", "vrp.download.config"));
File.WriteAllText(Environment.CurrentDirectory + "\\rclone\\hash.txt", string.Empty);
File.WriteAllText(Environment.CurrentDirectory + "\\rclone\\hash.txt", newConfig);
File.WriteAllText(Path.Combine(Environment.CurrentDirectory, "rclone", "hash.txt"), string.Empty);
File.WriteAllText(Path.Combine(Environment.CurrentDirectory, "rclone", "hash.txt"), newConfig);
}
else
{
_ = Logger.Log($"Updated Config Hash matches last download. Not updating.");
if (File.Exists(Environment.CurrentDirectory + "\\rclone\\vrp.download.config_new"))
if (File.Exists(Path.Combine(Environment.CurrentDirectory, "rclone", "vrp.download.config_new")))
{
File.Delete(Environment.CurrentDirectory + "\\rclone\\vrp.download.config_new");
File.Delete(Path.Combine(Environment.CurrentDirectory, "rclone", "vrp.download.config_new"));
}
}
}
@@ -257,7 +258,7 @@ namespace AndroidSideloader
_ = Logger.Log($"Retrieved updated config from: {configUrl}");
File.WriteAllText(Environment.CurrentDirectory + "\\rclone\\vrp.upload.config", resultString);
File.WriteAllText(Path.Combine(Environment.CurrentDirectory, "rclone", "vrp.upload.config"), resultString);
_ = Logger.Log("Upload config updated successfully.");
}
@@ -274,26 +275,44 @@ namespace AndroidSideloader
| SecurityProtocolType.Tls11
| SecurityProtocolType.Tls12
| SecurityProtocolType.Ssl3;
_ = Logger.Log($"Attempting to Update Public Config");
_ = 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 configUrl = "https://vrpirates.wiki/downloads/vrp-public.json";
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()))
{
string resultString = responseReader.ReadToEnd();
_ = Logger.Log($"Retrieved updated config from: {configUrl}");
File.WriteAllText(Environment.CurrentDirectory + "\\vrp-public.json", resultString);
_ = Logger.Log("Public config updated successfully.");
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 e)
catch (Exception mainException)
{
_ = Logger.Log($"Failed to update Public config: {e.Message}", LogLevel.ERROR);
_ = 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);
}
}
}

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.26";
public static readonly string LocalVersion = "2.27";
public static string currentVersion = string.Empty;
public static string changelog = string.Empty;
@@ -58,7 +58,7 @@ namespace AndroidSideloader
{
ServicePointManager.Expect100Continue = true;
ServicePointManager.SecurityProtocol = SecurityProtocolType.Tls12;
Logger.Log($"Downloading update from {GitHubUrl}/releases/download/v{currentVersion}/{AppName}.exe to {AppName} v{currentVersion}.exe");
fileClient.DownloadFile($"{GitHubUrl}/releases/download/v{currentVersion}/{AppName}.exe", $"{AppName} v{currentVersion}.exe");

View File

@@ -11,6 +11,11 @@ using System.Windows.Forms;
namespace AndroidSideloader.Utilities
{
public class ExtractionException : Exception
{
public ExtractionException(string message) : base(message) { }
}
internal class Zip
{
public static void ExtractFile(string sourceArchive, string destination)
@@ -25,14 +30,26 @@ namespace AndroidSideloader.Utilities
DoExtract(args);
}
private static string extractionError = null;
private static bool errorMessageShown = false;
private static void DoExtract(string args)
{
if (!File.Exists(Environment.CurrentDirectory + "\\7z.exe") || !File.Exists(Environment.CurrentDirectory + "\\7z.dll"))
if (!File.Exists(Path.Combine(Environment.CurrentDirectory, "7z.exe")) || !File.Exists(Path.Combine(Environment.CurrentDirectory, "7z.dll")))
{
_ = Logger.Log("Begin download 7-zip");
WebClient client = new WebClient();
client.DownloadFile("https://github.com/VRPirates/rookie/raw/master/7z.exe", "7z.exe");
client.DownloadFile("https://github.com/VRPirates/rookie/raw/master/7z.dll", "7z.dll");
string architecture = Environment.Is64BitOperatingSystem ? "64" : "";
try
{
client.DownloadFile($"https://github.com/VRPirates/rookie/raw/master/7z{architecture}.exe", $"7z.exe");
client.DownloadFile($"https://github.com/VRPirates/rookie/raw/master/7z{architecture}.dll", $"7z.dll");
}
catch (Exception ex)
{
_ = FlexibleMessageBox.Show($"You are unable to access the GitHub page with the Exception: {ex.Message}\nSome files may be missing (7z)");
_ = FlexibleMessageBox.Show("7z was unable to be downloaded\nRookie will now close");
Application.Exit();
}
_ = Logger.Log("Complete download 7-zip");
}
@@ -73,28 +90,43 @@ namespace AndroidSideloader.Utilities
}
};
}
x.ErrorDataReceived += (sender, e) => Console.WriteLine(e.Data);
x.ErrorDataReceived += (sender, e) =>
{
if (e.Data != null)
{
var error = e.Data;
if (error.Contains("There is not enough space on the disk") && !errorMessageShown)
{
errorMessageShown = true;
Program.form.Invoke(new Action(() =>
{
_ = FlexibleMessageBox.Show(Program.form, $"Not enough space to extract archive.\r\nMake sure your {Path.GetPathRoot(Properties.Settings.Default.downloadDir)} drive has at least double the space of the game, then try again.",
"NOT ENOUGH SPACE",
MessageBoxButtons.OK,
MessageBoxIcon.Error);
return;
}));
}
_ = Logger.Log(error, LogLevel.ERROR);
extractionError = $"Extracting failed, status code {x.ExitCode}";
return;
}
};
x.Start();
x.BeginOutputReadLine();
x.BeginErrorReadLine();
x.WaitForExit();
if (x.ExitCode != 0)
{
string error = x.StandardError.ReadToEnd();
errorMessageShown = false;
if (error.Contains("There is not enough space on the disk"))
{
_ = FlexibleMessageBox.Show(Program.form, $"Not enough space to extract archive.\r\nMake sure your {Path.GetPathRoot(Properties.Settings.Default.downloadDir)} drive has at least double the space of the game, then try again.",
"NOT ENOUGH SPACE",
MessageBoxButtons.OK,
MessageBoxIcon.Error);
}
_ = Logger.Log(x.StandardOutput.ReadToEnd());
_ = Logger.Log(error, LogLevel.ERROR);
throw new ApplicationException($"Extracting failed, status code {x.ExitCode}");
if (!string.IsNullOrEmpty(extractionError))
{
string errorMessage = extractionError;
extractionError = null; // Reset the error message
throw new ExtractionException(errorMessage);
}
}
}
}

View File

@@ -1,14 +1,7 @@
RSL 2.26
RSL 2.27
- Feature: Top right update labels will now show the amount of games per state
- Feature: Open Download Dir and Run ADB Commands added to left sidebar
- Feature: Toggle sideloading button
- Feature: Show progress of extraction
- Fix: Crash when failing to write to the StoredIP.txt
- Fix: Drag and drop + Copy OBB for Quest 3 users
- Fix: Properly kill off WebView2 instances
- Fix: Added parents to dialogs
- Fix: GUI freezing on launch
- Fix: No Device Mode output
- Chore: Make missing space message more user-friendly
- Chore: Remove QU Settings
- Feature: Searchbar can now also search release names
- Feature: Rookie will now download 64 bit 7zip binaries for faster extractions (when possible)
- Fix: 7zip error handler
- Fix: Crash when downloading without enough space
- Chore: Cleanup code

4
codenames Normal file
View File

@@ -0,0 +1,4 @@
monterey
hollywood
seacliff
eureka

34708
debuglog.txt

File diff suppressed because it is too large Load Diff

View File

@@ -1 +1 @@
2.26
2.27