Compare commits

...

60 Commits

Author SHA1 Message Date
Chax
49deba5771 Update Discord 2025-04-10 16:21:57 +02:00
Chax
56947d0648 Add favorite mechanism 2025-04-10 16:18:53 +02:00
Chax
f2c285c141 Show release notes with trailers enabled, this fixes #198 2025-03-22 13:15:51 +01:00
Chax
b4b2a42db5 Merge branch 'master' of https://github.com/VRPirates/rookie 2025-02-22 15:31:08 +01:00
Chax
3195116fdf Remove obsolete code 2025-02-22 15:31:00 +01:00
tastyratz
5df51cfcba Update AddDefenderExceptions.ps1
Pulled duplicate folder out
2025-02-22 15:29:59 +01:00
tastyratz
a6525bf885 Update AddDefenderExceptions.ps1
Tweaked for requested changes
2025-02-22 15:29:59 +01:00
tastyratz
516618bd5a Update AddDefenderExceptions.ps1
Added an auto elevate to admin section instead of admin check.

Replaced array of paths with psscriptroot for 2 reasons; 
1. This lets users exclude whatever folder they want regardless of install path
2. Defender excludes all subdirectories and files recursively making all those entries redundant https://support.microsoft.com/en-us/windows/add-an-exclusion-to-windows-security-811816c0-4dfd-af4a-47e4-c301afe13b26

Finally,
I added some sleeps and pauses for users to review messages and results/errors
2025-02-22 15:29:59 +01:00
Chax
098c0a07a3 Bump ver 2025-02-22 15:29:32 +01:00
Chax
74fcf91572 Lower ADB version to solve ADB outputting pushes to stderr 2025-02-22 15:25:37 +01:00
Chax
1fb77054d1 Allow users to cancel backup 2025-02-22 15:25:25 +01:00
Chax
c53db4bfc3 Revert 2c513ac7, too buggy. 2025-02-22 15:15:42 +01:00
Maxine
19909a82cb Merge pull request #171 from VRPirates/beta/RSL-2.32
RSL 2.32
2024-12-29 02:23:48 +01:00
fenopy
46196d128b feat: switch to offline mode when unable to connect (dont kill) 2024-12-27 09:27:50 -06:00
fenopy
f32bd15d98 feat: allow switching between pub and priv configs 2024-12-27 09:00:32 -06:00
fenopy
ce4cd9ad46 chore: add defender exceptions ps 2024-12-27 07:16:45 -06:00
fenopy
d91c41b19c version bump 2024-12-27 06:48:39 -06:00
fenopy
b38b8d1771 fix: move labels to avoid covering queues (#169) 2024-12-27 06:47:36 -06:00
fenopy
51941f2b73 fix: changes to mirror init to fix vip issues 2024-12-27 06:43:30 -06:00
Chax
5907e48018 Remove unneeded flush call 2024-12-21 14:59:47 +01:00
Chax
8d4d2c9711 This fixes #167 2024-12-21 14:59:09 +01:00
Chax
2c513ac7a8 Add saving the ColumnWidths, Window Sizes/Position 2024-12-14 14:02:40 +01:00
Chax
9a17dd70c1 Use Environment.CurrentDirectory instead 2024-12-14 12:57:57 +01:00
fenopy
72d2db3fcc Merge branch 'beta/RSL-2.32' of github.com:VRPirates/rookie into beta/RSL-2.32 2024-12-09 10:59:10 -06:00
fenopy
05cff37dd5 bump 7z to 24.09 2024-12-09 10:59:04 -06:00
fenopy
094d996249 bump adb aapt deps 2024-12-09 10:46:45 -06:00
Fenopy
c079f87fc6 Merge pull request #161 from VRPirates/beta/RSL-2.31.2
version bump
2024-12-09 10:30:41 -06:00
fenopy
288da1736e version bump 2024-12-09 10:30:04 -06:00
Fenopy
1160c24ad2 Merge pull request #156 from VRPirates/beta/RSL-2.31.1
Beta/rsl 2.31.1
2024-12-06 19:35:26 -06:00
fenopy
b2c8dd7d10 chore: linting 2024-12-06 18:33:04 -06:00
fenopy
59674fe781 fix: adult content filtering 2024-12-06 18:32:54 -06:00
fenopy
4b3b9b0558 version bump 2024-12-06 18:32:09 -06:00
Fenopy
866f8821a5 Merge pull request #155 from VRPirates/beta/RSL-2.31
fix: column sort for new popularity ratings
2024-12-06 13:26:07 -06:00
fenopy
2b4ec9af38 fix: column sort for new popularity ratings 2024-12-06 13:25:31 -06:00
Fenopy
6527a7ce31 Merge pull request #154 from VRPirates/beta/RSL-2.31
Beta/rsl 2.31
2024-12-06 13:13:48 -06:00
fenopy
aa9babfb18 chore: bump rclone to 1.68.2 2024-12-06 13:11:29 -06:00
fenopy
6e9b8a19f5 version bump 2024-12-06 12:49:30 -06:00
fenopy
62515ef59c fix: change "downloads" to "popularity" 2024-12-06 12:46:12 -06:00
fenopy
1d3830e0b2 fix: case insensitive packagename checks 2024-12-06 12:42:48 -06:00
fenopy
b62307310c fix: wrap trailer fetching in catch 2024-11-14 09:22:00 -06:00
fenopy
6b2841cd0c fix: change adult filter for new format 2024-11-14 08:35:19 -06:00
fenopy
a5b0e60acc chore: bump rclone to 1.68.1 2024-11-10 10:50:44 -06:00
fenopy
c084cf9bfb fix: always create log 2024-11-10 08:28:01 -06:00
fenopy
005918aec0 feat: preserve vrp.download.config on rclone update 2024-11-10 08:26:16 -06:00
fenopy
5eaf7d5498 fix: adult content filter 2024-11-10 08:23:35 -06:00
fenopy
b3ca9bcd66 Merge branch 'beta/RSL-2.31' of https://github.com/VRPirates/rookie into beta/RSL-2.31 2024-11-09 21:22:33 -06:00
fenopy
9aed677d3a chore: add build.cmd 2024-11-09 21:21:50 -06:00
Chax
1b66beb957 Fix OBB pushing on drag and drop. 2024-11-10 04:14:43 +01:00
fenopy
0e092df064 fix: update cleanupinstall to use userprofile instead of username 2024-11-09 21:07:24 -06:00
Chax
d80dc1c465 Add safeguard to prevent deletion of current directory 2024-11-05 00:19:56 +01:00
Chax
eed21ff56f Add intricate logging and trycatch block to initListView when checking for unrecognized app 2024-10-21 21:37:14 +02:00
fenopy
1471b6bb0b Merge remote-tracking branch 'origin/beta/RSL-2.30.1' into beta/RSL-2.31 2024-10-11 13:47:22 -05:00
Chax
f85d43d701 Revert putting the check in ShowPrcOutput and instead check in downloadInstallGameButton_Click & refreshGamesListAsync 2024-10-07 19:46:44 +02:00
Chax
73f0a840e9 Do not show ShowPrcOutput messages when settings.EnableMessageBoxes is disabled 2024-10-07 19:35:32 +02:00
Chax
a09e469491 Remove redundant SettingsManager calls & add HideAdultContent checkbox 2024-10-06 18:11:54 +02:00
Chax
1db593c634 Initiate SettingsManager in Logger.cs and Zip.cs & Save() when creating Instance 2024-10-05 18:34:30 +02:00
Chax
eb88d746c1 Switch away from using inbuilt settings and use a json 2024-10-05 17:09:12 +02:00
fenopy
f7b5c94136 fix: wrap adb in try to prevent crash 2024-10-04 08:44:15 -05:00
fenopy
58aa1be7c5 chore: update readme 2024-10-02 06:33:12 -05:00
Chax
426d99e519 Fix sorting in all numeric columns.
This closes #124
2024-09-23 20:47:16 +02:00
31 changed files with 1599 additions and 803 deletions

BIN
7z.dll

Binary file not shown.

BIN
7z.exe

Binary file not shown.

BIN
7z64.dll

Binary file not shown.

BIN
7z64.exe

Binary file not shown.

119
ADB.cs
View File

@@ -1,4 +1,5 @@
using JR.Utils.GUI.Forms;
using AndroidSideloader.Utilities;
using JR.Utils.GUI.Forms;
using System;
using System.Diagnostics;
using System.IO;
@@ -8,6 +9,7 @@ namespace AndroidSideloader
{
internal class ADB
{
private static readonly SettingsManager settings = SettingsManager.Instance;
private static readonly Process adb = new Process();
public static string adbFolderPath = Path.Combine(Path.GetPathRoot(Environment.SystemDirectory), "RSL", "platform-tools");
public static string adbFilePath = Path.Combine(adbFolderPath, "adb.exe");
@@ -18,9 +20,9 @@ namespace AndroidSideloader
// Replacing "adb" from command if the user added it
command = command.Replace("adb", "");
Properties.Settings.Default.ADBFolder = adbFolderPath;
Properties.Settings.Default.ADBPath = adbFilePath;
Properties.Settings.Default.Save();
settings.ADBFolder = adbFolderPath;
settings.ADBPath = adbFilePath;
settings.Save();
if (DeviceID.Length > 1)
{
command = $" -s {DeviceID} {command}";
@@ -68,7 +70,7 @@ namespace AndroidSideloader
}
}
if (error.Contains("ADB_VENDOR_KEYS") && !Properties.Settings.Default.adbdebugwarned)
if (error.Contains("ADB_VENDOR_KEYS") && !settings.AdbDebugWarned)
{
ADBDebugWarning();
}
@@ -137,7 +139,7 @@ namespace AndroidSideloader
adb.WaitForExit();
}
}
if (error.Contains("ADB_VENDOR_KEYS") && Properties.Settings.Default.adbdebugwarned)
if (error.Contains("ADB_VENDOR_KEYS") && settings.AdbDebugWarned)
{
ADBDebugWarning();
}
@@ -154,47 +156,65 @@ namespace AndroidSideloader
logcmd = logcmd.Replace($"{Environment.CurrentDirectory}", $"CurrentDirectory");
}
_ = Logger.Log($"Running command: {logcmd}");
adb.StartInfo.FileName = $@"{Path.GetPathRoot(Environment.SystemDirectory)}\Windows\System32\cmd.exe";
adb.StartInfo.Arguments = command;
adb.StartInfo.RedirectStandardError = true;
adb.StartInfo.RedirectStandardInput = true;
adb.StartInfo.RedirectStandardOutput = true;
adb.StartInfo.CreateNoWindow = true;
adb.StartInfo.UseShellExecute = false;
adb.StartInfo.WorkingDirectory = Path.GetDirectoryName(path);
_ = adb.Start();
adb.StandardInput.WriteLine(command);
adb.StandardInput.Flush();
adb.StandardInput.Close();
string output = "";
string error = "";
Logger.Log($"Running command: {logcmd}");
try
{
output += adb.StandardOutput.ReadToEnd();
error += adb.StandardError.ReadToEnd();
}
catch { }
if (command.Contains("connect"))
{
bool graceful = adb.WaitForExit(3000);
if (!graceful)
using (var adb = new Process())
{
adb.Kill();
adb.WaitForExit();
adb.StartInfo.FileName = $@"{Path.GetPathRoot(Environment.SystemDirectory)}\Windows\System32\cmd.exe";
adb.StartInfo.Arguments = command;
adb.StartInfo.RedirectStandardError = true;
adb.StartInfo.RedirectStandardInput = true;
adb.StartInfo.RedirectStandardOutput = true;
adb.StartInfo.CreateNoWindow = true;
adb.StartInfo.UseShellExecute = false;
adb.StartInfo.WorkingDirectory = Path.GetDirectoryName(path);
adb.Start();
adb.StandardInput.WriteLine(command);
adb.StandardInput.Flush();
adb.StandardInput.Close();
string output = adb.StandardOutput.ReadToEnd();
string error = adb.StandardError.ReadToEnd();
if (command.Contains("connect"))
{
bool graceful = adb.WaitForExit(3000);
if (!graceful)
{
adb.Kill();
adb.WaitForExit();
}
}
else
{
adb.WaitForExit();
}
if (error.Contains("ADB_VENDOR_KEYS") && settings.AdbDebugWarned)
{
ADBDebugWarning();
}
if (error.Contains("Asset path") && error.Contains("is neither a directory nor file"))
{
Logger.Log("Asset path error detected. The specified path might not exist or be accessible.", LogLevel.WARNING);
// You might want to handle this specific error differently
}
Logger.Log(output);
Logger.Log(error, LogLevel.ERROR);
return new ProcessOutput(output, error);
}
}
if (error.Contains("ADB_VENDOR_KEYS") && Properties.Settings.Default.adbdebugwarned)
catch (Exception ex)
{
ADBDebugWarning();
Logger.Log($"Error in RunCommandToString: {ex.Message}", LogLevel.ERROR);
return new ProcessOutput("", $"Exception occurred: {ex.Message}");
}
_ = Logger.Log(output);
_ = Logger.Log(error, LogLevel.ERROR);
return new ProcessOutput(output, error);
}
public static void ADBDebugWarning()
@@ -204,8 +224,8 @@ namespace AndroidSideloader
DialogResult dialogResult = FlexibleMessageBox.Show(Program.form, "On your headset, click on the Notifications Bell, and then select the USB Detected notification to enable Connections.", "ADB Debugging not enabled.", MessageBoxButtons.OKCancel);
if (dialogResult == DialogResult.Cancel)
{
// Properties.Settings.Default.adbdebugwarned = true;
Properties.Settings.Default.Save();
// settings.adbdebugwarned = true;
settings.Save();
}
});
}
@@ -246,7 +266,6 @@ namespace AndroidSideloader
public static bool wirelessadbON;
public static ProcessOutput Sideload(string path, string packagename = "")
{
ProcessOutput ret = new ProcessOutput();
ret += RunAdbCommandToString($"install -g \"{path}\"");
string out2 = ret.Output + ret.Error;
@@ -254,7 +273,7 @@ namespace AndroidSideloader
{
_ = Path.Combine(Environment.GetFolderPath(Environment.SpecialFolder.MyDocuments), $"Rookie Backups");
_ = Logger.Log(out2);
if (out2.Contains("offline") && !Properties.Settings.Default.nodevicemode)
if (out2.Contains("offline") && !settings.NodeviceMode)
{
DialogResult dialogResult2 = FlexibleMessageBox.Show(Program.form, "Device is offline. Press Yes to reconnect, or if you don't wish to connect and just want to download the game (requires unchecking \"Delete games after install\" from settings menu) then press No.", "Device offline.", MessageBoxButtons.YesNoCancel);
}
@@ -262,11 +281,11 @@ namespace AndroidSideloader
{
ret.Error = string.Empty;
ret.Output = string.Empty;
if (!Properties.Settings.Default.AutoReinstall)
if (!settings.AutoReinstall)
{
bool cancelClicked = false;
if (!Properties.Settings.Default.AutoReinstall)
if (!settings.AutoReinstall)
{
Program.form.Invoke((MethodInvoker)(() =>
{
@@ -289,12 +308,16 @@ namespace AndroidSideloader
Program.form.changeTitle("Reinstalling Game");
ret += ADB.RunAdbCommandToString($"install -g \"{path}\"");
_ = ADB.RunAdbCommandToString($"push \"{Environment.CurrentDirectory}\\{MainForm.CurrPCKG}\" /sdcard/Android/data/");
if (Directory.Exists($"{Environment.CurrentDirectory}\\{MainForm.CurrPCKG}"))
string directoryToDelete = Path.Combine(Environment.CurrentDirectory, MainForm.CurrPCKG);
if (Directory.Exists(directoryToDelete))
{
Directory.Delete($"{Environment.CurrentDirectory}\\{MainForm.CurrPCKG}", true);
if (directoryToDelete != Environment.CurrentDirectory)
{
Directory.Delete(directoryToDelete, true);
}
}
Program.form.changeTitle(" \n\n");
Program.form.changeTitle(" \n\n");
return ret;
}
}

72
AddDefenderExceptions.ps1 Normal file
View File

@@ -0,0 +1,72 @@
# Run this script as Administrator
# powershell -ExecutionPolicy Bypass -File "C:\RSL\Rookie\AddDefenderExceptions.ps1"
################################################################
## Auto Elevate to Admin if not running as admin
################################################################
# Get the ID and security principal of the current user account
$WindowsID = [System.Security.Principal.WindowsIdentity]::GetCurrent()
$WindowsPrincipal = New-Object System.Security.Principal.WindowsPrincipal ($WindowsID)
# Get the security principal for the Administrator role
$AdminRole = [System.Security.Principal.WindowsBuiltInRole]::Administrator
# Check to see if we are currently running "as Administrator"
if ($WindowsPrincipal.IsInRole($AdminRole)) {
# We are running "as Administrator" - so change the title and background color to indicate this
$Host.UI.RawUI.WindowTitle = $myInvocation.MyCommand.Definition + " (Elevated)"
$Host.UI.RawUI.BackgroundColor = "DarkBlue"
Clear-Host
} else {
# We are not running "as Administrator" - so relaunch as administrator
# Create a new process object that starts PowerShell
$NewProcess = New-Object System.Diagnostics.ProcessStartInfo "PowerShell";
# Specify the current script path and name as a parameter
$NewProcess.Arguments = $myInvocation.MyCommand.Definition;
# Indicate that the process should be elevated
$NewProcess.Verb = "runas";
# Start the new process
[System.Diagnostics.Process]::Start($NewProcess);
# Exit from the current unelevated process
exit
}
write-host "Run this script from the directory root with which Rookie will be run"
start-sleep -s 5
$paths = @(
"$PSScriptRoot", # Replaces 'C:\RSL' with the script's root directory
"$PSScriptRoot\rclone",
"$PSScriptRoot\Sideloader Launcher.exe",
"$PSScriptRoot\AndroidSideloader*.exe",
"$PSScriptRoot\rclone\rclone.exe"
)
foreach ($path in $paths) {
try {
Add-MpPreference -ExclusionPath $Path -ErrorAction Stop
Write-Host "Successfully added exclusion for: $path" -ForegroundColor Green
}
catch {
Write-Host "Failed to add exclusion for: $path " -ForegroundColor Red
Write-Host "Error: $_" -ForegroundColor Red
Start-Sleep -s 5
Pause
}
}
# Verify the exclusions
Write-Host "`nCurrent exclusions:" -ForegroundColor Cyan
$defenderPreferences = Get-MpPreference
$paths | ForEach-Object {
if ($defenderPreferences.ExclusionPath -contains $_) {
Write-Host "$_ is already excluded from Defender."
} else {
Write-Host "$_ is NOT excluded from Defender."
}
}
Pause
Start-Sleep -s 5

View File

@@ -194,6 +194,7 @@
</Compile>
<Compile Include="FlexibleMessageBox.cs" />
<Compile Include="RoundedRectangleF.cs" />
<Compile Include="Settings.cs" />
<Compile Include="Sideloader\GetDependencies.cs" />
<Compile Include="Splash.cs">
<SubType>Form</SubType>
@@ -249,6 +250,7 @@
<Compile Include="Program.cs" />
<Compile Include="Properties\AssemblyInfo.cs" />
<Compile Include="SelectFolder.cs" />
<Compile Include="Utilities\SettingsManager.cs" />
<Compile Include="Utilities\StringUtilities.cs" />
<Compile Include="Utilities\GeneralUtilities.cs" />
<Compile Include="Utilities\UpdateGameData.cs" />
@@ -312,6 +314,9 @@
<None Include="CleanupInstall.cmd">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</None>
<None Include="AddDefenderExceptions.ps1">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</None>
<None Include="version" />
</ItemGroup>
<ItemGroup>

View File

@@ -1,4 +1,68 @@
RSL 2.29
RSL 2.32
- Feature: Allow switching between Public and Private configs
- Feature: Switch to Offline Mode when unable to connect
- Feature: Save window position and column sizes
- Fix: An issue that caused the VIP mirror to fail
- Fix: Make video window flexible
- Fix: Issue when saving Settings file
- Fix: Change Label position to avoid overlapping Queue/Notes windows
- Chore: Bump aapt/aapt2/adb to latest
- Chore: Bump 7z to 24.09
- Chore: Add AddDefenderExceptions.ps1
RSL 2.31.1
- Fix: Filtering when Adult Content is shown
RSL 2.31
- Feature: Preserve download.config during rclone update
- Feature: Added toggle to hide Adult Content
- Fix: Changed settings configuration to settings.json
- Fix: Always create debuglog on first-launch
- Fix: Fixed numeric sorting
- Fix: Wrap ADB commands to prevent crash
- Fix: Update CleanupInstall to use UserProfile instead of Username
- Fix: Fix to OBB pushing when Dragging and Dropping
- Fix: Do not show ShowPrcOutput messages when "Enable Message Boxes" is disabled
- Fix: Add safeguard to prevent deletion of current directory
- Fix: Case insensitive package matching
- Chore: Add build batch
- Chore: Bump rclone to 1.68.2 (from 1.67.0)
RSL 2.30
- Feature: Added Download Metrics
-- Upon downloading a game, Rookie will attempt to log the download count with our server
-- No additional data is collected except for the Package Name and VersionCode of the Game being downloaded
- Feature: Added Downloads column to Gamelist
-- Downloads counts are updated nightly
- Feature: Added "Send Command" button to ADB Commands prompt (Enter still works)
- Feature: Small changes to how the Upload Mirror works
-- Rookie can now verify game uploads are successful
- Feature: Add Cleanup Install script
- Feature: Added additional Splashes to indicate loading status
- Feature: Added setting to supress Re-Download prompt
- Feature: Added "Disable Checking for New Apps" argument (for Testers sanity)
- Feature: Added Bandwidth Limiter to Settings
- Fix: Fixes for using Sponsored Mirrors
-- Eliminated downloading of vrp.download.config from the wiki
-- Fixed issue where Rookie would check for the mirror before it was loaded in
- Fix: Add quotes around all ADB path commands
- Fix: Public Mirror label not displaying
- Fix: Allow spaces when setting username
- Fix: Prevent Rookie from constantly prompting for the Public Config
- Fix: Fixed issue where the Game List doesn't copy/export properly
- Fix: Fixed issue where dropping an entire folder doesn't read the install.txt
- Chore: Remove random mirror picker (no longer used)
- Chore: Changed unable to connect message
- Chore: Remove Offline Mode popup
- Chore: Remove unused dependencies
- Chore: Rename random assets
- Chore: Bump rclone to 1.67.0 (from 1.66.0)
RSL 2.29
- Feature: Prompt to keep temporary files and allow resuming of downloads
- Feature: Fixed progress bar jump-back

View File

@@ -7,7 +7,7 @@ echo Killing adb.exe processes...
taskkill /F /FI "IMAGENAME eq adb.exe" /T
set "folderPath=C:\Users\%username%\AppData\Local\Rookie.WTF\"
set "folderPath=%userprofile%\AppData\Local\Rookie.WTF\"
echo Deleting contents of %folderPath%...
for /D %%i in ("%folderPath%\*") do (
rd /s /q "%%i"
@@ -15,7 +15,7 @@ for /D %%i in ("%folderPath%\*") do (
del /q "%folderPath%\*.*"
set "folderPath=C:\Users\%username%\AppData\Local\Rookie.AndroidSideloader\"
set "folderPath=%userprofile%\AppData\Local\Rookie.AndroidSideloader\"
echo Deleting contents of %folderPath%...
for /D %%i in ("%folderPath%\*") do (
rd /s /q "%%i"

View File

@@ -2,90 +2,102 @@
using System.Windows.Forms;
/// <summary>
/// This class is an implementation of the 'IComparer' interface.
/// A custom comparer for sorting ListView columns, implementing the 'IComparer' interface.
/// </summary>
public class ListViewColumnSorter : IComparer
{
/// <summary>
/// Case insensitive comparer object
/// Case-insensitive comparer object used for comparing strings.
/// </summary>
private readonly CaseInsensitiveComparer ObjectCompare;
/// <summary>
/// Class constructor. Initializes various elements
/// Initializes a new instance of the ListViewColumnSorter class and sets default sorting parameters.
/// </summary>
public ListViewColumnSorter()
{
// Initialize the column to '0'
// Default column index for sorting
SortColumn = 0;
// Initialize the sort order to 'none'
// Default sorting order
Order = SortOrder.Ascending;
// Initialize the CaseInsensitiveComparer object
// Initialize the case-insensitive comparer
ObjectCompare = new CaseInsensitiveComparer();
}
/// <summary>
/// This method is inherited from the IComparer interface. It compares the two objects passed using a case insensitive comparison.
/// Compares two ListViewItem objects based on the specified column index and sorting order.
/// </summary>
/// <param name="x">First object to be compared</param>
/// <param name="y">Second object to be compared</param>
/// <returns>The result of the comparison. "0" if equal, negative if 'x' is less than 'y' and positive if 'x' is greater than 'y'</returns>
/// <param name="x">First ListViewItem object to compare.</param>
/// <param name="y">Second ListViewItem object to compare.</param>
/// <returns>
/// A signed integer indicating the relative values of x and y:
/// "0" if equal, a negative number if x is less than y, and a positive number if x is greater than y.
/// </returns>
public int Compare(object x, object y)
{
int compareResult;
ListViewItem listviewX, listviewY;
ListViewItem listviewX = (ListViewItem)x;
ListViewItem listviewY = (ListViewItem)y;
// Cast the objects to be compared to ListViewItem objects
listviewX = (ListViewItem)x;
listviewY = (ListViewItem)y;
if (SortColumn == 5 || SortColumn == 6)
// Determine if the column requires numeric comparison
if (SortColumn == 3 || SortColumn == 5) // Numeric columns: VersionCodeIndex, VersionNameIndex
{
try
{
int yNum = int.Parse(cleanNumber(listviewY.SubItems[SortColumn].Text));
int xNum = int.Parse(cleanNumber(listviewX.SubItems[SortColumn].Text));
return xNum == yNum ? 0 : xNum > yNum && Order == SortOrder.Ascending ? -1 : 1;
// Parse and compare numeric values directly
int xNum = ParseNumber(listviewX.SubItems[SortColumn].Text);
int yNum = ParseNumber(listviewY.SubItems[SortColumn].Text);
// Compare numerically
compareResult = xNum.CompareTo(yNum);
}
catch { }
catch
{
// Fallback to string comparison if parsing fails
compareResult = ObjectCompare.Compare(listviewX.SubItems[SortColumn].Text, listviewY.SubItems[SortColumn].Text);
}
}
else
{
// Default to string comparison for non-numeric columns
compareResult = ObjectCompare.Compare(listviewX.SubItems[SortColumn].Text, listviewY.SubItems[SortColumn].Text);
}
// Compare the two items
compareResult = ObjectCompare.Compare(listviewX.SubItems[SortColumn].Text, listviewY.SubItems[SortColumn].Text);
// Calculate correct return value based on object comparison
// Determine the return value based on the specified sort order
if (Order == SortOrder.Ascending)
{
// Ascending sort is selected, return normal result of compare operation
return compareResult;
}
else if (Order == SortOrder.Descending)
{
// Descending sort is selected, return negative result of compare operation
return -compareResult;
}
else
{
// Return '0' to indicate they are equal
return 0;
return 0; // Indicate equality
}
}
/// <summary>
/// Gets or sets the number of the column to which to apply the sorting operation (Defaults to '0').
/// Parses a numeric value from a string for accurate numeric comparison.
/// </summary>
public int SortColumn { set; get; }
/// <summary>
/// Gets or sets the order of sorting to apply (for example, 'Ascending' or 'Descending').
/// </summary>
public SortOrder Order { set; get; }
private string cleanNumber(string number)
/// <param name="text">The string representation of the number.</param>
/// <returns>The parsed integer value; returns 0 if parsing fails.</returns>
private int ParseNumber(string text)
{
return number.Substring(0);
// Directly attempt to parse the string as an integer
return int.TryParse(text, out int result) ? result : 0;
}
}
/// <summary>
/// Gets or sets the index of the column to be sorted (default is '0').
/// </summary>
public int SortColumn { get; set; }
/// <summary>
/// Gets or sets the order of sorting (Ascending or Descending).
/// </summary>
public SortOrder Order { get; set; }
}

201
MainForm.Designer.cs generated
View File

@@ -105,7 +105,6 @@ namespace AndroidSideloader
this.speedLabel_Tooltip = new System.Windows.Forms.ToolTip(this.components);
this.etaLabel_Tooltip = new System.Windows.Forms.ToolTip(this.components);
this.progressDLbtnContainer = new System.Windows.Forms.Panel();
this.downloadInstallGameButton = new AndroidSideloader.RoundButton();
this.diskLabel = new System.Windows.Forms.Label();
this.bottomContainer = new System.Windows.Forms.Panel();
this.deviceDrop = new System.Windows.Forms.Button();
@@ -125,10 +124,14 @@ namespace AndroidSideloader
this.leftNavContainer = new System.Windows.Forms.Panel();
this.tableLayoutPanel1 = new System.Windows.Forms.TableLayoutPanel();
this.webView21 = new Microsoft.Web.WebView2.WinForms.WebView2();
this.favoriteGame = new System.Windows.Forms.ContextMenuStrip(this.components);
this.favoriteButton = new System.Windows.Forms.ToolStripMenuItem();
this.favoriteSwitcher = new AndroidSideloader.RoundButton();
this.adbCmd_btnSend = new AndroidSideloader.RoundButton();
this.adbCmd_btnToggleUpdates = new AndroidSideloader.RoundButton();
this.downloadInstallGameButton = new AndroidSideloader.RoundButton();
this.MountButton = new AndroidSideloader.RoundButton();
this.btnNoDevice = new AndroidSideloader.RoundButton();
this.adbCmd_btnSend = new AndroidSideloader.RoundButton();
((System.ComponentModel.ISupportInitialize)(this.gamesPictureBox)).BeginInit();
this.progressDLbtnContainer.SuspendLayout();
this.bottomContainer.SuspendLayout();
@@ -141,6 +144,7 @@ namespace AndroidSideloader
this.leftNavContainer.SuspendLayout();
this.tableLayoutPanel1.SuspendLayout();
((System.ComponentModel.ISupportInitialize)(this.webView21)).BeginInit();
this.favoriteGame.SuspendLayout();
this.SuspendLayout();
//
// m_combo
@@ -166,7 +170,7 @@ namespace AndroidSideloader
this.progressBar.Location = new System.Drawing.Point(2, 0);
this.progressBar.MinimumSize = new System.Drawing.Size(200, 13);
this.progressBar.Name = "progressBar";
this.progressBar.Size = new System.Drawing.Size(482, 13);
this.progressBar.Size = new System.Drawing.Size(553, 13);
this.progressBar.TabIndex = 7;
//
// speedLabel
@@ -193,7 +197,7 @@ namespace AndroidSideloader
this.etaLabel.DataBindings.Add(new System.Windows.Forms.Binding("Font", global::AndroidSideloader.Properties.Settings.Default, "FontStyle", true, System.Windows.Forms.DataSourceUpdateMode.OnPropertyChanged));
this.etaLabel.Font = global::AndroidSideloader.Properties.Settings.Default.FontStyle;
this.etaLabel.ForeColor = global::AndroidSideloader.Properties.Settings.Default.FontColor;
this.etaLabel.Location = new System.Drawing.Point(288, 14);
this.etaLabel.Location = new System.Drawing.Point(359, 14);
this.etaLabel.Margin = new System.Windows.Forms.Padding(2, 0, 2, 0);
this.etaLabel.Name = "etaLabel";
this.etaLabel.Size = new System.Drawing.Size(196, 18);
@@ -234,7 +238,7 @@ namespace AndroidSideloader
this.gamesQueListBox.Location = new System.Drawing.Point(601, 493);
this.gamesQueListBox.Margin = new System.Windows.Forms.Padding(2);
this.gamesQueListBox.Name = "gamesQueListBox";
this.gamesQueListBox.Size = new System.Drawing.Size(485, 128);
this.gamesQueListBox.Size = new System.Drawing.Size(556, 128);
this.gamesQueListBox.TabIndex = 9;
this.gamesQueListBox.MouseClick += new System.Windows.Forms.MouseEventHandler(this.gamesQueListBox_MouseClick);
this.gamesQueListBox.DragDrop += new System.Windows.Forms.DragEventHandler(this.Form1_DragDrop);
@@ -266,10 +270,10 @@ namespace AndroidSideloader
this.remotesList.Font = global::AndroidSideloader.Properties.Settings.Default.FontStyle;
this.remotesList.ForeColor = global::AndroidSideloader.Properties.Settings.Default.FontColor;
this.remotesList.FormattingEnabled = true;
this.remotesList.Location = new System.Drawing.Point(545, 40);
this.remotesList.Location = new System.Drawing.Point(531, 40);
this.remotesList.Margin = new System.Windows.Forms.Padding(2);
this.remotesList.Name = "remotesList";
this.remotesList.Size = new System.Drawing.Size(53, 26);
this.remotesList.Size = new System.Drawing.Size(67, 26);
this.remotesList.TabIndex = 3;
this.remotesList.SelectedIndexChanged += new System.EventHandler(this.remotesList_SelectedIndexChanged);
//
@@ -295,7 +299,7 @@ namespace AndroidSideloader
this.gamesListView.Location = new System.Drawing.Point(224, 98);
this.gamesListView.Name = "gamesListView";
this.gamesListView.ShowGroups = false;
this.gamesListView.Size = new System.Drawing.Size(862, 350);
this.gamesListView.Size = new System.Drawing.Size(933, 350);
this.gamesListView.TabIndex = 6;
this.gamesListView.UseCompatibleStateImageBehavior = false;
this.gamesListView.View = System.Windows.Forms.View.Details;
@@ -303,6 +307,7 @@ namespace AndroidSideloader
this.gamesListView.SelectedIndexChanged += new System.EventHandler(this.gamesListView_SelectedIndexChanged);
this.gamesListView.DragDrop += new System.Windows.Forms.DragEventHandler(this.Form1_DragDrop);
this.gamesListView.DragEnter += new System.Windows.Forms.DragEventHandler(this.Form1_DragEnter);
this.gamesListView.MouseClick += new System.Windows.Forms.MouseEventHandler(this.gamesListView_MouseClick);
this.gamesListView.MouseDoubleClick += new System.Windows.Forms.MouseEventHandler(this.gamesListView_MouseDoubleClick);
//
// GameNameIndex
@@ -338,7 +343,7 @@ namespace AndroidSideloader
//
// DownloadsIndex
//
this.DownloadsIndex.Text = "Downloads";
this.DownloadsIndex.Text = "Popularity";
this.DownloadsIndex.TextAlign = System.Windows.Forms.HorizontalAlignment.Right;
this.DownloadsIndex.Width = 80;
//
@@ -356,7 +361,7 @@ namespace AndroidSideloader
this.searchTextBox.Location = new System.Drawing.Point(224, 70);
this.searchTextBox.MinimumSize = new System.Drawing.Size(231, 26);
this.searchTextBox.Name = "searchTextBox";
this.searchTextBox.Size = new System.Drawing.Size(862, 26);
this.searchTextBox.Size = new System.Drawing.Size(933, 26);
this.searchTextBox.TabIndex = 5;
this.searchTextBox.Text = "Search";
this.searchTextBox.Click += new System.EventHandler(this.searchTextBox_Click);
@@ -372,7 +377,7 @@ namespace AndroidSideloader
this.gamesQueueLabel.DataBindings.Add(new System.Windows.Forms.Binding("Font", global::AndroidSideloader.Properties.Settings.Default, "FontStyle", true, System.Windows.Forms.DataSourceUpdateMode.OnPropertyChanged));
this.gamesQueueLabel.Font = global::AndroidSideloader.Properties.Settings.Default.FontStyle;
this.gamesQueueLabel.ForeColor = global::AndroidSideloader.Properties.Settings.Default.FontColor;
this.gamesQueueLabel.Location = new System.Drawing.Point(599, 603);
this.gamesQueueLabel.Location = new System.Drawing.Point(971, 603);
this.gamesQueueLabel.Name = "gamesQueueLabel";
this.gamesQueueLabel.Size = new System.Drawing.Size(123, 18);
this.gamesQueueLabel.TabIndex = 86;
@@ -404,7 +409,7 @@ namespace AndroidSideloader
this.notesRichTextBox.ReadOnly = true;
this.notesRichTextBox.ScrollBars = System.Windows.Forms.RichTextBoxScrollBars.Vertical;
this.notesRichTextBox.ShowSelectionMargin = true;
this.notesRichTextBox.Size = new System.Drawing.Size(485, 81);
this.notesRichTextBox.Size = new System.Drawing.Size(556, 81);
this.notesRichTextBox.TabIndex = 10;
this.notesRichTextBox.Text = "\n\n\n TIP: PRESS F1 TO SEE A LIST OF SHORTCUTS";
//
@@ -432,7 +437,7 @@ namespace AndroidSideloader
this.lblNotes.DataBindings.Add(new System.Windows.Forms.Binding("Font", global::AndroidSideloader.Properties.Settings.Default, "FontStyle", true, System.Windows.Forms.DataSourceUpdateMode.OnPropertyChanged));
this.lblNotes.Font = global::AndroidSideloader.Properties.Settings.Default.FontStyle;
this.lblNotes.ForeColor = global::AndroidSideloader.Properties.Settings.Default.FontColor;
this.lblNotes.Location = new System.Drawing.Point(597, 689);
this.lblNotes.Location = new System.Drawing.Point(988, 689);
this.lblNotes.Name = "lblNotes";
this.lblNotes.Size = new System.Drawing.Size(106, 18);
this.lblNotes.TabIndex = 86;
@@ -489,9 +494,9 @@ namespace AndroidSideloader
this.lblMirror.ForeColor = System.Drawing.SystemColors.ControlLightLight;
this.lblMirror.Location = new System.Drawing.Point(475, 44);
this.lblMirror.Name = "lblMirror";
this.lblMirror.Size = new System.Drawing.Size(65, 17);
this.lblMirror.Size = new System.Drawing.Size(51, 17);
this.lblMirror.TabIndex = 90;
this.lblMirror.Text = "Mirror #";
this.lblMirror.Text = "Mirror";
this.lblMirror.TextAlign = System.Drawing.ContentAlignment.TopCenter;
//
// adbCmd_CommandBox
@@ -982,37 +987,9 @@ namespace AndroidSideloader
this.progressDLbtnContainer.Location = new System.Drawing.Point(224, 454);
this.progressDLbtnContainer.MinimumSize = new System.Drawing.Size(600, 34);
this.progressDLbtnContainer.Name = "progressDLbtnContainer";
this.progressDLbtnContainer.Size = new System.Drawing.Size(862, 34);
this.progressDLbtnContainer.Size = new System.Drawing.Size(933, 34);
this.progressDLbtnContainer.TabIndex = 96;
//
// downloadInstallGameButton
//
this.downloadInstallGameButton.Active1 = System.Drawing.Color.FromArgb(((int)(((byte)(40)))), ((int)(((byte)(40)))), ((int)(((byte)(40)))));
this.downloadInstallGameButton.Active2 = System.Drawing.Color.FromArgb(((int)(((byte)(40)))), ((int)(((byte)(40)))), ((int)(((byte)(40)))));
this.downloadInstallGameButton.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Right)));
this.downloadInstallGameButton.BackColor = System.Drawing.Color.FromArgb(((int)(((byte)(20)))), ((int)(((byte)(20)))), ((int)(((byte)(20)))));
this.downloadInstallGameButton.DataBindings.Add(new System.Windows.Forms.Binding("BackColor", global::AndroidSideloader.Properties.Settings.Default, "SubButtonColor", true, System.Windows.Forms.DataSourceUpdateMode.OnPropertyChanged));
this.downloadInstallGameButton.DataBindings.Add(new System.Windows.Forms.Binding("ForeColor", global::AndroidSideloader.Properties.Settings.Default, "FontColor", true, System.Windows.Forms.DataSourceUpdateMode.OnPropertyChanged));
this.downloadInstallGameButton.DataBindings.Add(new System.Windows.Forms.Binding("Font", global::AndroidSideloader.Properties.Settings.Default, "FontStyle", true, System.Windows.Forms.DataSourceUpdateMode.OnPropertyChanged));
this.downloadInstallGameButton.DialogResult = System.Windows.Forms.DialogResult.OK;
this.downloadInstallGameButton.Font = new System.Drawing.Font("Microsoft Sans Serif", 11.25F);
this.downloadInstallGameButton.ForeColor = global::AndroidSideloader.Properties.Settings.Default.FontColor;
this.downloadInstallGameButton.Inactive1 = System.Drawing.Color.FromArgb(((int)(((byte)(20)))), ((int)(((byte)(20)))), ((int)(((byte)(20)))));
this.downloadInstallGameButton.Inactive2 = System.Drawing.Color.FromArgb(((int)(((byte)(20)))), ((int)(((byte)(20)))), ((int)(((byte)(20)))));
this.downloadInstallGameButton.Location = new System.Drawing.Point(498, 0);
this.downloadInstallGameButton.Margin = new System.Windows.Forms.Padding(0);
this.downloadInstallGameButton.Name = "downloadInstallGameButton";
this.downloadInstallGameButton.Radius = 5;
this.downloadInstallGameButton.Size = new System.Drawing.Size(364, 34);
this.downloadInstallGameButton.Stroke = true;
this.downloadInstallGameButton.StrokeColor = System.Drawing.Color.FromArgb(((int)(((byte)(74)))), ((int)(((byte)(74)))), ((int)(((byte)(74)))));
this.downloadInstallGameButton.TabIndex = 94;
this.downloadInstallGameButton.Text = "Download and Install Game/Add To Queue ⮩ ";
this.downloadInstallGameButton.Transparency = false;
this.downloadInstallGameButton.Click += new System.EventHandler(this.downloadInstallGameButton_Click);
this.downloadInstallGameButton.DragDrop += new System.Windows.Forms.DragEventHandler(this.Form1_DragDrop);
this.downloadInstallGameButton.DragEnter += new System.Windows.Forms.DragEventHandler(this.Form1_DragEnter);
//
// diskLabel
//
this.diskLabel.AutoSize = true;
@@ -1274,7 +1251,7 @@ namespace AndroidSideloader
this.verLabel.BackColor = System.Drawing.Color.Transparent;
this.verLabel.Font = new System.Drawing.Font("Segoe UI", 11.25F, System.Drawing.FontStyle.Bold);
this.verLabel.ForeColor = System.Drawing.SystemColors.Control;
this.verLabel.Location = new System.Drawing.Point(1030, 721);
this.verLabel.Location = new System.Drawing.Point(1101, 721);
this.verLabel.Name = "verLabel";
this.verLabel.RightToLeft = System.Windows.Forms.RightToLeft.Yes;
this.verLabel.Size = new System.Drawing.Size(68, 20);
@@ -1316,7 +1293,7 @@ namespace AndroidSideloader
this.tableLayoutPanel1.Controls.Add(this.lblUpToDate, 0, 0);
this.tableLayoutPanel1.Controls.Add(this.lblUpdateAvailable, 0, 1);
this.tableLayoutPanel1.Controls.Add(this.lblNeedsDonate, 0, 2);
this.tableLayoutPanel1.Location = new System.Drawing.Point(860, 2);
this.tableLayoutPanel1.Location = new System.Drawing.Point(931, 2);
this.tableLayoutPanel1.Name = "tableLayoutPanel1";
this.tableLayoutPanel1.RightToLeft = System.Windows.Forms.RightToLeft.No;
this.tableLayoutPanel1.RowCount = 3;
@@ -1330,6 +1307,7 @@ namespace AndroidSideloader
// webView21
//
this.webView21.AllowExternalDrop = true;
this.webView21.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Left)));
this.webView21.CreationProperties = null;
this.webView21.DefaultBackgroundColor = System.Drawing.Color.White;
this.webView21.Location = new System.Drawing.Point(224, 493);
@@ -1338,6 +1316,75 @@ namespace AndroidSideloader
this.webView21.TabIndex = 98;
this.webView21.ZoomFactor = 1D;
//
// favoriteGame
//
this.favoriteGame.Items.AddRange(new System.Windows.Forms.ToolStripItem[] {
this.favoriteButton});
this.favoriteGame.Name = "favoriteGame";
this.favoriteGame.Size = new System.Drawing.Size(117, 26);
//
// favoriteButton
//
this.favoriteButton.BackColor = System.Drawing.Color.FromArgb(((int)(((byte)(20)))), ((int)(((byte)(20)))), ((int)(((byte)(20)))));
this.favoriteButton.ForeColor = System.Drawing.Color.White;
this.favoriteButton.Name = "favoriteButton";
this.favoriteButton.Size = new System.Drawing.Size(116, 22);
this.favoriteButton.Text = "Favorite";
this.favoriteButton.Click += new System.EventHandler(this.favoriteButton_Click);
//
// favoriteSwitcher
//
this.favoriteSwitcher.Active1 = System.Drawing.Color.FromArgb(((int)(((byte)(40)))), ((int)(((byte)(40)))), ((int)(((byte)(40)))));
this.favoriteSwitcher.Active2 = System.Drawing.Color.FromArgb(((int)(((byte)(40)))), ((int)(((byte)(40)))), ((int)(((byte)(40)))));
this.favoriteSwitcher.BackColor = System.Drawing.Color.FromArgb(((int)(((byte)(20)))), ((int)(((byte)(20)))), ((int)(((byte)(20)))));
this.favoriteSwitcher.BackgroundImageLayout = System.Windows.Forms.ImageLayout.None;
this.favoriteSwitcher.Cursor = System.Windows.Forms.Cursors.Default;
this.favoriteSwitcher.DataBindings.Add(new System.Windows.Forms.Binding("BackColor", global::AndroidSideloader.Properties.Settings.Default, "SubButtonColor", true, System.Windows.Forms.DataSourceUpdateMode.OnPropertyChanged));
this.favoriteSwitcher.DataBindings.Add(new System.Windows.Forms.Binding("ForeColor", global::AndroidSideloader.Properties.Settings.Default, "FontColor", true, System.Windows.Forms.DataSourceUpdateMode.OnPropertyChanged));
this.favoriteSwitcher.DataBindings.Add(new System.Windows.Forms.Binding("Font", global::AndroidSideloader.Properties.Settings.Default, "FontStyle", true, System.Windows.Forms.DataSourceUpdateMode.OnPropertyChanged));
this.favoriteSwitcher.DialogResult = System.Windows.Forms.DialogResult.OK;
this.favoriteSwitcher.Font = new System.Drawing.Font("Microsoft Sans Serif", 11.25F);
this.favoriteSwitcher.ForeColor = global::AndroidSideloader.Properties.Settings.Default.FontColor;
this.favoriteSwitcher.Inactive1 = System.Drawing.Color.FromArgb(((int)(((byte)(20)))), ((int)(((byte)(20)))), ((int)(((byte)(20)))));
this.favoriteSwitcher.Inactive2 = System.Drawing.Color.FromArgb(((int)(((byte)(20)))), ((int)(((byte)(20)))), ((int)(((byte)(20)))));
this.favoriteSwitcher.Location = new System.Drawing.Point(786, 34);
this.favoriteSwitcher.Name = "favoriteSwitcher";
this.favoriteSwitcher.Radius = 5;
this.favoriteSwitcher.Size = new System.Drawing.Size(168, 28);
this.favoriteSwitcher.Stroke = true;
this.favoriteSwitcher.StrokeColor = System.Drawing.Color.FromArgb(((int)(((byte)(74)))), ((int)(((byte)(74)))), ((int)(((byte)(74)))));
this.favoriteSwitcher.TabIndex = 101;
this.favoriteSwitcher.Text = "Games List";
this.favoriteSwitcher.Transparency = false;
this.favoriteSwitcher.Click += new System.EventHandler(this.favoriteSwitcher_Click);
//
// adbCmd_btnSend
//
this.adbCmd_btnSend.Active1 = System.Drawing.Color.FromArgb(((int)(((byte)(40)))), ((int)(((byte)(40)))), ((int)(((byte)(40)))));
this.adbCmd_btnSend.Active2 = System.Drawing.Color.FromArgb(((int)(((byte)(40)))), ((int)(((byte)(40)))), ((int)(((byte)(40)))));
this.adbCmd_btnSend.BackColor = System.Drawing.Color.FromArgb(((int)(((byte)(20)))), ((int)(((byte)(20)))), ((int)(((byte)(20)))));
this.adbCmd_btnSend.BackgroundImageLayout = System.Windows.Forms.ImageLayout.None;
this.adbCmd_btnSend.Cursor = System.Windows.Forms.Cursors.Default;
this.adbCmd_btnSend.DataBindings.Add(new System.Windows.Forms.Binding("BackColor", global::AndroidSideloader.Properties.Settings.Default, "SubButtonColor", true, System.Windows.Forms.DataSourceUpdateMode.OnPropertyChanged));
this.adbCmd_btnSend.DataBindings.Add(new System.Windows.Forms.Binding("ForeColor", global::AndroidSideloader.Properties.Settings.Default, "FontColor", true, System.Windows.Forms.DataSourceUpdateMode.OnPropertyChanged));
this.adbCmd_btnSend.DataBindings.Add(new System.Windows.Forms.Binding("Font", global::AndroidSideloader.Properties.Settings.Default, "FontStyle", true, System.Windows.Forms.DataSourceUpdateMode.OnPropertyChanged));
this.adbCmd_btnSend.DialogResult = System.Windows.Forms.DialogResult.OK;
this.adbCmd_btnSend.Font = new System.Drawing.Font("Microsoft Sans Serif", 11.25F);
this.adbCmd_btnSend.ForeColor = global::AndroidSideloader.Properties.Settings.Default.FontColor;
this.adbCmd_btnSend.Inactive1 = System.Drawing.Color.FromArgb(((int)(((byte)(20)))), ((int)(((byte)(20)))), ((int)(((byte)(20)))));
this.adbCmd_btnSend.Inactive2 = System.Drawing.Color.FromArgb(((int)(((byte)(20)))), ((int)(((byte)(20)))), ((int)(((byte)(20)))));
this.adbCmd_btnSend.Location = new System.Drawing.Point(478, 262);
this.adbCmd_btnSend.Name = "adbCmd_btnSend";
this.adbCmd_btnSend.Radius = 5;
this.adbCmd_btnSend.Size = new System.Drawing.Size(126, 28);
this.adbCmd_btnSend.Stroke = true;
this.adbCmd_btnSend.StrokeColor = System.Drawing.Color.FromArgb(((int)(((byte)(74)))), ((int)(((byte)(74)))), ((int)(((byte)(74)))));
this.adbCmd_btnSend.TabIndex = 100;
this.adbCmd_btnSend.Text = "Send Command";
this.adbCmd_btnSend.Transparency = false;
this.adbCmd_btnSend.Visible = false;
this.adbCmd_btnSend.Click += new System.EventHandler(this.adbCmd_btnSend_Click);
//
// adbCmd_btnToggleUpdates
//
this.adbCmd_btnToggleUpdates.Active1 = System.Drawing.Color.FromArgb(((int)(((byte)(40)))), ((int)(((byte)(40)))), ((int)(((byte)(40)))));
@@ -1365,6 +1412,34 @@ namespace AndroidSideloader
this.adbCmd_btnToggleUpdates.Visible = false;
this.adbCmd_btnToggleUpdates.Click += new System.EventHandler(this.adbCmd_btnToggleUpdates_Click);
//
// downloadInstallGameButton
//
this.downloadInstallGameButton.Active1 = System.Drawing.Color.FromArgb(((int)(((byte)(40)))), ((int)(((byte)(40)))), ((int)(((byte)(40)))));
this.downloadInstallGameButton.Active2 = System.Drawing.Color.FromArgb(((int)(((byte)(40)))), ((int)(((byte)(40)))), ((int)(((byte)(40)))));
this.downloadInstallGameButton.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Right)));
this.downloadInstallGameButton.BackColor = System.Drawing.Color.FromArgb(((int)(((byte)(20)))), ((int)(((byte)(20)))), ((int)(((byte)(20)))));
this.downloadInstallGameButton.DataBindings.Add(new System.Windows.Forms.Binding("BackColor", global::AndroidSideloader.Properties.Settings.Default, "SubButtonColor", true, System.Windows.Forms.DataSourceUpdateMode.OnPropertyChanged));
this.downloadInstallGameButton.DataBindings.Add(new System.Windows.Forms.Binding("ForeColor", global::AndroidSideloader.Properties.Settings.Default, "FontColor", true, System.Windows.Forms.DataSourceUpdateMode.OnPropertyChanged));
this.downloadInstallGameButton.DataBindings.Add(new System.Windows.Forms.Binding("Font", global::AndroidSideloader.Properties.Settings.Default, "FontStyle", true, System.Windows.Forms.DataSourceUpdateMode.OnPropertyChanged));
this.downloadInstallGameButton.DialogResult = System.Windows.Forms.DialogResult.OK;
this.downloadInstallGameButton.Font = new System.Drawing.Font("Microsoft Sans Serif", 11.25F);
this.downloadInstallGameButton.ForeColor = global::AndroidSideloader.Properties.Settings.Default.FontColor;
this.downloadInstallGameButton.Inactive1 = System.Drawing.Color.FromArgb(((int)(((byte)(20)))), ((int)(((byte)(20)))), ((int)(((byte)(20)))));
this.downloadInstallGameButton.Inactive2 = System.Drawing.Color.FromArgb(((int)(((byte)(20)))), ((int)(((byte)(20)))), ((int)(((byte)(20)))));
this.downloadInstallGameButton.Location = new System.Drawing.Point(569, 0);
this.downloadInstallGameButton.Margin = new System.Windows.Forms.Padding(0);
this.downloadInstallGameButton.Name = "downloadInstallGameButton";
this.downloadInstallGameButton.Radius = 5;
this.downloadInstallGameButton.Size = new System.Drawing.Size(364, 34);
this.downloadInstallGameButton.Stroke = true;
this.downloadInstallGameButton.StrokeColor = System.Drawing.Color.FromArgb(((int)(((byte)(74)))), ((int)(((byte)(74)))), ((int)(((byte)(74)))));
this.downloadInstallGameButton.TabIndex = 94;
this.downloadInstallGameButton.Text = "Download and Install Game/Add To Queue ⮩ ";
this.downloadInstallGameButton.Transparency = false;
this.downloadInstallGameButton.Click += new System.EventHandler(this.downloadInstallGameButton_Click);
this.downloadInstallGameButton.DragDrop += new System.Windows.Forms.DragEventHandler(this.Form1_DragDrop);
this.downloadInstallGameButton.DragEnter += new System.Windows.Forms.DragEventHandler(this.Form1_DragEnter);
//
// MountButton
//
this.MountButton.Active1 = System.Drawing.Color.FromArgb(((int)(((byte)(40)))), ((int)(((byte)(40)))), ((int)(((byte)(40)))));
@@ -1418,33 +1493,6 @@ namespace AndroidSideloader
this.btnNoDevice.Transparency = false;
this.btnNoDevice.Click += new System.EventHandler(this.btnNoDevice_Click);
//
// adbCmd_btnSend
//
this.adbCmd_btnSend.Active1 = System.Drawing.Color.FromArgb(((int)(((byte)(40)))), ((int)(((byte)(40)))), ((int)(((byte)(40)))));
this.adbCmd_btnSend.Active2 = System.Drawing.Color.FromArgb(((int)(((byte)(40)))), ((int)(((byte)(40)))), ((int)(((byte)(40)))));
this.adbCmd_btnSend.BackColor = System.Drawing.Color.FromArgb(((int)(((byte)(20)))), ((int)(((byte)(20)))), ((int)(((byte)(20)))));
this.adbCmd_btnSend.BackgroundImageLayout = System.Windows.Forms.ImageLayout.None;
this.adbCmd_btnSend.Cursor = System.Windows.Forms.Cursors.Default;
this.adbCmd_btnSend.DataBindings.Add(new System.Windows.Forms.Binding("BackColor", global::AndroidSideloader.Properties.Settings.Default, "SubButtonColor", true, System.Windows.Forms.DataSourceUpdateMode.OnPropertyChanged));
this.adbCmd_btnSend.DataBindings.Add(new System.Windows.Forms.Binding("ForeColor", global::AndroidSideloader.Properties.Settings.Default, "FontColor", true, System.Windows.Forms.DataSourceUpdateMode.OnPropertyChanged));
this.adbCmd_btnSend.DataBindings.Add(new System.Windows.Forms.Binding("Font", global::AndroidSideloader.Properties.Settings.Default, "FontStyle", true, System.Windows.Forms.DataSourceUpdateMode.OnPropertyChanged));
this.adbCmd_btnSend.DialogResult = System.Windows.Forms.DialogResult.OK;
this.adbCmd_btnSend.Font = new System.Drawing.Font("Microsoft Sans Serif", 11.25F);
this.adbCmd_btnSend.ForeColor = global::AndroidSideloader.Properties.Settings.Default.FontColor;
this.adbCmd_btnSend.Inactive1 = System.Drawing.Color.FromArgb(((int)(((byte)(20)))), ((int)(((byte)(20)))), ((int)(((byte)(20)))));
this.adbCmd_btnSend.Inactive2 = System.Drawing.Color.FromArgb(((int)(((byte)(20)))), ((int)(((byte)(20)))), ((int)(((byte)(20)))));
this.adbCmd_btnSend.Location = new System.Drawing.Point(478, 262);
this.adbCmd_btnSend.Name = "adbCmd_btnSend";
this.adbCmd_btnSend.Radius = 5;
this.adbCmd_btnSend.Size = new System.Drawing.Size(126, 28);
this.adbCmd_btnSend.Stroke = true;
this.adbCmd_btnSend.StrokeColor = System.Drawing.Color.FromArgb(((int)(((byte)(74)))), ((int)(((byte)(74)))), ((int)(((byte)(74)))));
this.adbCmd_btnSend.TabIndex = 100;
this.adbCmd_btnSend.Text = "Send Command";
this.adbCmd_btnSend.Transparency = false;
this.adbCmd_btnSend.Visible = false;
this.adbCmd_btnSend.Click += new System.EventHandler(this.adbCmd_btnSend_Click);
//
// MainForm
//
this.AllowDrop = true;
@@ -1452,7 +1500,8 @@ namespace AndroidSideloader
this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
this.BackColor = global::AndroidSideloader.Properties.Settings.Default.BackColor;
this.BackgroundImage = global::AndroidSideloader.Properties.Resources.pattern_cubes;
this.ClientSize = new System.Drawing.Size(1104, 747);
this.ClientSize = new System.Drawing.Size(1175, 747);
this.Controls.Add(this.favoriteSwitcher);
this.Controls.Add(this.adbCmd_btnSend);
this.Controls.Add(this.adbCmd_btnToggleUpdates);
this.Controls.Add(this.ULLabel);
@@ -1508,6 +1557,7 @@ namespace AndroidSideloader
this.tableLayoutPanel1.ResumeLayout(false);
this.tableLayoutPanel1.PerformLayout();
((System.ComponentModel.ISupportInitialize)(this.webView21)).EndInit();
this.favoriteGame.ResumeLayout(false);
this.ResumeLayout(false);
this.PerformLayout();
@@ -1609,5 +1659,8 @@ namespace AndroidSideloader
private RoundButton btnNoDevice;
private RoundButton adbCmd_btnToggleUpdates;
private RoundButton adbCmd_btnSend;
private ContextMenuStrip favoriteGame;
private ToolStripMenuItem favoriteButton;
private RoundButton favoriteSwitcher;
}
}

File diff suppressed because it is too large Load Diff

View File

@@ -180,4 +180,10 @@
<metadata name="listApkButton_Tooltip.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">
<value>955, 17</value>
</metadata>
<metadata name="favoriteGame.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">
<value>855, 95</value>
</metadata>
<metadata name="$this.TrayHeight" type="System.Int32, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
<value>161</value>
</metadata>
</root>

View File

@@ -1,4 +1,5 @@
using System;
using AndroidSideloader.Utilities;
using System;
using System.IO;
using System.Security.Permissions;
using System.Windows.Forms;
@@ -7,6 +8,7 @@ namespace AndroidSideloader
{
internal static class Program
{
private static readonly SettingsManager settings = SettingsManager.Instance;
/// <summary>
/// The main entry point for the application.
/// </summary>
@@ -19,12 +21,6 @@ namespace AndroidSideloader
currentDomain.UnhandledException += new UnhandledExceptionEventHandler(CrashHandler);
Application.EnableVisualStyles();
Application.SetCompatibleTextRenderingDefault(false);
if (AndroidSideloader.Properties.Settings.Default.UpdateSettings)
{
AndroidSideloader.Properties.Settings.Default.Upgrade();
AndroidSideloader.Properties.Settings.Default.UpdateSettings = false;
AndroidSideloader.Properties.Settings.Default.Save();
}
form = new MainForm();
Application.Run(form);
//form.Show();
@@ -41,9 +37,9 @@ namespace AndroidSideloader
string date_time = DateTime.Now.ToString("dddd, MMMM dd @ hh:mmtt (UTC)");
File.WriteAllText(Sideloader.CrashLogPath, $"Date/Time of crash: {date_time}\nMessage: {e.Message}\nInner Message: {innerExceptionMessage}\nData: {e.Data}\nSource: {e.Source}\nTargetSite: {e.TargetSite}\nStack Trace: \n{e.StackTrace}\n\n\nDebuglog: \n\n\n");
// If a debuglog exists we append it to the crashlog.
if (File.Exists(Properties.Settings.Default.CurrentLogPath))
if (File.Exists(settings.CurrentLogPath))
{
File.AppendAllText(Sideloader.CrashLogPath, File.ReadAllText($"{Properties.Settings.Default.CurrentLogPath}"));
File.AppendAllText(Sideloader.CrashLogPath, File.ReadAllText($"{settings.CurrentLogPath}"));
}
}
}

View File

@@ -1,4 +1,5 @@
using System;
using AndroidSideloader.Utilities;
using System;
using System.IO;
using System.Windows.Forms;
@@ -6,6 +7,7 @@ namespace AndroidSideloader
{
public partial class QuestForm : Form
{
private static readonly SettingsManager settings = SettingsManager.Instance;
public static int length = 0;
public static string[] result;
public bool settingsexist = false;
@@ -85,27 +87,26 @@ namespace AndroidSideloader
{
if (DeleteShots.Checked)
{
Properties.Settings.Default.delsh = true;
Properties.Settings.Default.Save();
settings.Delsh = true;
settings.Save();
}
if (!DeleteShots.Checked)
{
Properties.Settings.Default.delsh = false;
Properties.Settings.Default.Save();
settings.Delsh = false;
settings.Save();
}
}
private void QuestForm_Load(object sender, EventArgs e)
{
DeleteShots.Checked = Properties.Settings.Default.delsh;
GlobalUsername.Text = Properties.Settings.Default.GlobalUsername;
DeleteShots.Checked = settings.Delsh;
GlobalUsername.Text = settings.GlobalUsername;
}
private void DeleteButton_Click(object sender, EventArgs e)
{
_ = MessageBox.Show("Ok, Deleted your custom settings file.\nIf you would like to re-enable return here and apply settings again");
File.Delete($"{Properties.Settings.Default.MainDir}\\Config.Json");
File.Delete($"{settings.MainDir}\\Config.Json");
}
private void questPics_Click(object sender, EventArgs e)
{
@@ -181,8 +182,8 @@ namespace AndroidSideloader
private void GlobalUsername_TextChanged(object sender, EventArgs e)
{
btnApplyUsername.Enabled = GlobalUsername.TextLength > 0;
Properties.Settings.Default.GlobalUsername = GlobalUsername.Text;
Properties.Settings.Default.Save();
settings.GlobalUsername = GlobalUsername.Text;
settings.Save();
}
}
}

View File

@@ -1,4 +1,5 @@
using JR.Utils.GUI.Forms;
using AndroidSideloader.Utilities;
using JR.Utils.GUI.Forms;
using System;
using System.Diagnostics;
using System.IO;
@@ -10,6 +11,7 @@ namespace AndroidSideloader
{
internal class RCLONE
{
private static readonly SettingsManager settings = SettingsManager.Instance;
// Kill RCLONE Processes that were started from Rookie by looking for child processes.
public static void killRclone()
{
@@ -84,9 +86,9 @@ namespace AndroidSideloader
}
string logcmd = Utilities.StringUtilities.RemoveEverythingBeforeFirst(command, "rclone.exe");
if (logcmd.Contains($"\"{Properties.Settings.Default.CurrentLogPath}\""))
if (logcmd.Contains($"\"{settings.CurrentLogPath}\""))
{
logcmd = logcmd.Replace($"\"{Properties.Settings.Default.CurrentLogPath}\"", $"\"{Properties.Settings.Default.CurrentLogName}\"");
logcmd = logcmd.Replace($"\"{settings.CurrentLogPath}\"", $"\"{settings.CurrentLogName}\"");
}
if (logcmd.Contains(Environment.CurrentDirectory))
@@ -111,7 +113,6 @@ namespace AndroidSideloader
rclone.StartInfo.UseShellExecute = false;
_ = rclone.Start();
rclone.StandardInput.WriteLine(command);
rclone.StandardInput.Flush();
rclone.StandardInput.Close();
string output = rclone.StandardOutput.ReadToEnd();
@@ -122,7 +123,7 @@ namespace AndroidSideloader
{
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.",
_ = 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 {settings.DownloadDir} and try again.",
"NOT ENOUGH SPACE",
MessageBoxButtons.OK,
MessageBoxIcon.Error);
@@ -134,16 +135,19 @@ namespace AndroidSideloader
if (error.Contains("400 Bad Request") || error.Contains("cannot fetch token") || error.Contains("authError") || error.Contains("quota") || error.Contains("exceeded") || error.Contains("directory not found") || error.Contains("Failed to"))
{
string oldRemote = MainForm.currentRemote;
bool retSM = false;
try
{
Program.form.SwitchMirrors();
retSM = Program.form.SwitchMirrors();
}
catch
{
return new ProcessOutput("All mirrors are on quota or down...", "All mirrors are on quota or down...");
}
prcoutput = runRcloneCommand_DownloadConfig(originalCommand.Replace(oldRemote, MainForm.currentRemote));
if (retSM)
{
prcoutput = runRcloneCommand_DownloadConfig(originalCommand.Replace(oldRemote, MainForm.currentRemote));
}
}
else
{
@@ -179,9 +183,9 @@ namespace AndroidSideloader
}
string logcmd = Utilities.StringUtilities.RemoveEverythingBeforeFirst(command, "rclone.exe");
if (logcmd.Contains($"\"{Properties.Settings.Default.CurrentLogPath}\""))
if (logcmd.Contains($"\"{settings.CurrentLogPath}\""))
{
logcmd = logcmd.Replace($"\"{Properties.Settings.Default.CurrentLogPath}\"", $"\"{Properties.Settings.Default.CurrentLogName}\"");
logcmd = logcmd.Replace($"\"{settings.CurrentLogPath}\"", $"\"{settings.CurrentLogName}\"");
}
if (logcmd.Contains(Environment.CurrentDirectory))
@@ -254,9 +258,9 @@ namespace AndroidSideloader
rclone.StartInfo.StandardOutputEncoding = Encoding.UTF8;
string logcmd = Utilities.StringUtilities.RemoveEverythingBeforeFirst(command, "rclone.exe");
if (logcmd.Contains($"\"{Properties.Settings.Default.CurrentLogPath}\""))
if (logcmd.Contains($"\"{settings.CurrentLogPath}\""))
{
logcmd = logcmd.Replace($"\"{Properties.Settings.Default.CurrentLogPath}\"", $"\"{Properties.Settings.Default.CurrentLogName}\"");
logcmd = logcmd.Replace($"\"{settings.CurrentLogPath}\"", $"\"{settings.CurrentLogName}\"");
}
if (logcmd.Contains(Environment.CurrentDirectory))
@@ -296,7 +300,7 @@ namespace AndroidSideloader
{
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.",
_ = 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 {settings.DownloadDir} and try again.",
"NOT ENOUGH SPACE",
MessageBoxButtons.OK,
MessageBoxIcon.Error);

View File

@@ -7,8 +7,6 @@
## Disclaimer
This application might get flagged as malware by some antivirus software; however, both the Sideloader and the Sideloader Launcher are open source.
**Latest VirusTotal Scan (3/72):** [Check here](https://www.virustotal.com/gui/file/04ce50b0cf7fddaaac3e1940e21234ddfc6f05d352891989f8067310f4ec6a69)
To run properly, Rookie must be extracted to a non-Protected folder on your drive. We recommend running Rookie from C:\RSL\Rookie
Do Not use folders such as- C:\Users; C:\Users\Desktop; C:\Program Files; OneDrive; Google Drive; etc...

28
Settings.cs Normal file
View File

@@ -0,0 +1,28 @@
namespace AndroidSideloader.Properties {
// This class allows you to handle specific events on the settings class:
// The SettingChanging event is raised before a setting's value is changed.
// The PropertyChanged event is raised after a setting's value is changed.
// The SettingsLoaded event is raised after the setting values are loaded.
// The SettingsSaving event is raised before the setting values are saved.
internal sealed partial class Settings {
public Settings() {
// // To add event handlers for saving and changing settings, uncomment the lines below:
//
// this.SettingChanging += this.SettingChangingEventHandler;
//
// this.SettingsSaving += this.SettingsSavingEventHandler;
//
}
private void SettingChangingEventHandler(object sender, System.Configuration.SettingChangingEventArgs e) {
// Add code to handle the SettingChangingEvent event here.
}
private void SettingsSavingEventHandler(object sender, System.ComponentModel.CancelEventArgs e) {
// Add code to handle the SettingsSaving event here.
}
}
}

View File

@@ -57,6 +57,7 @@ namespace AndroidSideloader
this.bandwidthLabel = new System.Windows.Forms.Label();
this.bandwidthLimitTextBox = new System.Windows.Forms.TextBox();
this.label1 = new System.Windows.Forms.Label();
this.hideAdultContentCheckBox = new System.Windows.Forms.CheckBox();
this.SuspendLayout();
//
// checkForUpdatesCheckBox
@@ -227,7 +228,7 @@ namespace AndroidSideloader
this.setBackupDirectory.ForeColor = System.Drawing.Color.White;
this.setBackupDirectory.Inactive1 = System.Drawing.Color.FromArgb(((int)(((byte)(25)))), ((int)(((byte)(25)))), ((int)(((byte)(25)))));
this.setBackupDirectory.Inactive2 = System.Drawing.Color.FromArgb(((int)(((byte)(25)))), ((int)(((byte)(25)))), ((int)(((byte)(25)))));
this.setBackupDirectory.Location = new System.Drawing.Point(28, 596);
this.setBackupDirectory.Location = new System.Drawing.Point(26, 628);
this.setBackupDirectory.Name = "setBackupDirectory";
this.setBackupDirectory.Radius = 5;
this.setBackupDirectory.Size = new System.Drawing.Size(285, 31);
@@ -248,7 +249,7 @@ namespace AndroidSideloader
this.setDownloadDirectory.ForeColor = System.Drawing.Color.White;
this.setDownloadDirectory.Inactive1 = System.Drawing.Color.FromArgb(((int)(((byte)(25)))), ((int)(((byte)(25)))), ((int)(((byte)(25)))));
this.setDownloadDirectory.Inactive2 = System.Drawing.Color.FromArgb(((int)(((byte)(25)))), ((int)(((byte)(25)))), ((int)(((byte)(25)))));
this.setDownloadDirectory.Location = new System.Drawing.Point(28, 559);
this.setDownloadDirectory.Location = new System.Drawing.Point(26, 591);
this.setDownloadDirectory.Name = "setDownloadDirectory";
this.setDownloadDirectory.Radius = 5;
this.setDownloadDirectory.Size = new System.Drawing.Size(285, 31);
@@ -269,7 +270,7 @@ namespace AndroidSideloader
this.btnOpenDebug.ForeColor = System.Drawing.Color.White;
this.btnOpenDebug.Inactive1 = System.Drawing.Color.FromArgb(((int)(((byte)(25)))), ((int)(((byte)(25)))), ((int)(((byte)(25)))));
this.btnOpenDebug.Inactive2 = System.Drawing.Color.FromArgb(((int)(((byte)(25)))), ((int)(((byte)(25)))), ((int)(((byte)(25)))));
this.btnOpenDebug.Location = new System.Drawing.Point(27, 432);
this.btnOpenDebug.Location = new System.Drawing.Point(25, 464);
this.btnOpenDebug.Name = "btnOpenDebug";
this.btnOpenDebug.Radius = 5;
this.btnOpenDebug.Size = new System.Drawing.Size(285, 31);
@@ -290,7 +291,7 @@ namespace AndroidSideloader
this.btnResetDebug.ForeColor = System.Drawing.Color.White;
this.btnResetDebug.Inactive1 = System.Drawing.Color.FromArgb(((int)(((byte)(25)))), ((int)(((byte)(25)))), ((int)(((byte)(25)))));
this.btnResetDebug.Inactive2 = System.Drawing.Color.FromArgb(((int)(((byte)(25)))), ((int)(((byte)(25)))), ((int)(((byte)(25)))));
this.btnResetDebug.Location = new System.Drawing.Point(27, 469);
this.btnResetDebug.Location = new System.Drawing.Point(25, 501);
this.btnResetDebug.Name = "btnResetDebug";
this.btnResetDebug.Radius = 5;
this.btnResetDebug.Size = new System.Drawing.Size(285, 31);
@@ -311,7 +312,7 @@ namespace AndroidSideloader
this.btnUploadDebug.ForeColor = System.Drawing.Color.White;
this.btnUploadDebug.Inactive1 = System.Drawing.Color.FromArgb(((int)(((byte)(25)))), ((int)(((byte)(25)))), ((int)(((byte)(25)))));
this.btnUploadDebug.Inactive2 = System.Drawing.Color.FromArgb(((int)(((byte)(25)))), ((int)(((byte)(25)))), ((int)(((byte)(25)))));
this.btnUploadDebug.Location = new System.Drawing.Point(27, 506);
this.btnUploadDebug.Location = new System.Drawing.Point(25, 538);
this.btnUploadDebug.Name = "btnUploadDebug";
this.btnUploadDebug.Radius = 5;
this.btnUploadDebug.Size = new System.Drawing.Size(285, 31);
@@ -332,7 +333,7 @@ namespace AndroidSideloader
this.resetSettingsButton.ForeColor = System.Drawing.Color.White;
this.resetSettingsButton.Inactive1 = System.Drawing.Color.FromArgb(((int)(((byte)(25)))), ((int)(((byte)(25)))), ((int)(((byte)(25)))));
this.resetSettingsButton.Inactive2 = System.Drawing.Color.FromArgb(((int)(((byte)(25)))), ((int)(((byte)(25)))), ((int)(((byte)(25)))));
this.resetSettingsButton.Location = new System.Drawing.Point(180, 379);
this.resetSettingsButton.Location = new System.Drawing.Point(178, 411);
this.resetSettingsButton.Name = "resetSettingsButton";
this.resetSettingsButton.Radius = 5;
this.resetSettingsButton.Size = new System.Drawing.Size(133, 31);
@@ -356,7 +357,7 @@ namespace AndroidSideloader
this.applyButton.ForeColor = global::AndroidSideloader.Properties.Settings.Default.FontColor;
this.applyButton.Inactive1 = System.Drawing.Color.FromArgb(((int)(((byte)(25)))), ((int)(((byte)(25)))), ((int)(((byte)(25)))));
this.applyButton.Inactive2 = System.Drawing.Color.FromArgb(((int)(((byte)(25)))), ((int)(((byte)(25)))), ((int)(((byte)(25)))));
this.applyButton.Location = new System.Drawing.Point(28, 379);
this.applyButton.Location = new System.Drawing.Point(26, 411);
this.applyButton.Name = "applyButton";
this.applyButton.Radius = 5;
this.applyButton.Size = new System.Drawing.Size(133, 31);
@@ -391,7 +392,7 @@ namespace AndroidSideloader
this.openBackupDirectory.ForeColor = System.Drawing.Color.White;
this.openBackupDirectory.Inactive1 = System.Drawing.Color.FromArgb(((int)(((byte)(25)))), ((int)(((byte)(25)))), ((int)(((byte)(25)))));
this.openBackupDirectory.Inactive2 = System.Drawing.Color.FromArgb(((int)(((byte)(25)))), ((int)(((byte)(25)))), ((int)(((byte)(25)))));
this.openBackupDirectory.Location = new System.Drawing.Point(28, 670);
this.openBackupDirectory.Location = new System.Drawing.Point(26, 702);
this.openBackupDirectory.Name = "openBackupDirectory";
this.openBackupDirectory.Radius = 5;
this.openBackupDirectory.Size = new System.Drawing.Size(285, 31);
@@ -412,7 +413,7 @@ namespace AndroidSideloader
this.openDownloadDirectory.ForeColor = System.Drawing.Color.White;
this.openDownloadDirectory.Inactive1 = System.Drawing.Color.FromArgb(((int)(((byte)(25)))), ((int)(((byte)(25)))), ((int)(((byte)(25)))));
this.openDownloadDirectory.Inactive2 = System.Drawing.Color.FromArgb(((int)(((byte)(25)))), ((int)(((byte)(25)))), ((int)(((byte)(25)))));
this.openDownloadDirectory.Location = new System.Drawing.Point(28, 633);
this.openDownloadDirectory.Location = new System.Drawing.Point(26, 665);
this.openDownloadDirectory.Name = "openDownloadDirectory";
this.openDownloadDirectory.Radius = 5;
this.openDownloadDirectory.Size = new System.Drawing.Size(285, 31);
@@ -442,7 +443,7 @@ namespace AndroidSideloader
this.bandwidthLabel.AutoSize = true;
this.bandwidthLabel.BackColor = System.Drawing.Color.Transparent;
this.bandwidthLabel.Font = new System.Drawing.Font("Microsoft Sans Serif", 11.25F);
this.bandwidthLabel.Location = new System.Drawing.Point(10, 338);
this.bandwidthLabel.Location = new System.Drawing.Point(8, 370);
this.bandwidthLabel.Name = "bandwidthLabel";
this.bandwidthLabel.Size = new System.Drawing.Size(115, 18);
this.bandwidthLabel.TabIndex = 30;
@@ -455,7 +456,7 @@ namespace AndroidSideloader
this.bandwidthLimitTextBox.BorderStyle = System.Windows.Forms.BorderStyle.FixedSingle;
this.bandwidthLimitTextBox.Font = new System.Drawing.Font("Microsoft Sans Serif", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
this.bandwidthLimitTextBox.ForeColor = System.Drawing.Color.White;
this.bandwidthLimitTextBox.Location = new System.Drawing.Point(131, 336);
this.bandwidthLimitTextBox.Location = new System.Drawing.Point(129, 368);
this.bandwidthLimitTextBox.Name = "bandwidthLimitTextBox";
this.bandwidthLimitTextBox.Size = new System.Drawing.Size(46, 21);
this.bandwidthLimitTextBox.TabIndex = 31;
@@ -467,19 +468,34 @@ namespace AndroidSideloader
this.label1.AutoSize = true;
this.label1.BackColor = System.Drawing.Color.Transparent;
this.label1.Font = new System.Drawing.Font("Microsoft Sans Serif", 11.25F);
this.label1.Location = new System.Drawing.Point(183, 338);
this.label1.Location = new System.Drawing.Point(181, 370);
this.label1.Name = "label1";
this.label1.Size = new System.Drawing.Size(43, 18);
this.label1.TabIndex = 32;
this.label1.Text = "MB/s";
//
// hideAdultContentCheckBox
//
this.hideAdultContentCheckBox.AutoSize = true;
this.hideAdultContentCheckBox.BackColor = System.Drawing.Color.Transparent;
this.hideAdultContentCheckBox.DataBindings.Add(new System.Windows.Forms.Binding("Font", global::AndroidSideloader.Properties.Settings.Default, "FontStyle", true, System.Windows.Forms.DataSourceUpdateMode.OnPropertyChanged));
this.hideAdultContentCheckBox.Font = global::AndroidSideloader.Properties.Settings.Default.FontStyle;
this.hideAdultContentCheckBox.Location = new System.Drawing.Point(13, 336);
this.hideAdultContentCheckBox.Name = "hideAdultContentCheckBox";
this.hideAdultContentCheckBox.Size = new System.Drawing.Size(149, 22);
this.hideAdultContentCheckBox.TabIndex = 33;
this.hideAdultContentCheckBox.Text = "Hide Adult Content";
this.hideAdultContentCheckBox.UseVisualStyleBackColor = true;
this.hideAdultContentCheckBox.CheckedChanged += new System.EventHandler(this.hideAdultContentCheckBox_CheckedChanged);
//
// SettingsForm
//
this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F);
this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
this.BackColor = global::AndroidSideloader.Properties.Settings.Default.BackColor;
this.BackgroundImage = ((System.Drawing.Image)(resources.GetObject("$this.BackgroundImage")));
this.ClientSize = new System.Drawing.Size(339, 724);
this.ClientSize = new System.Drawing.Size(339, 746);
this.Controls.Add(this.hideAdultContentCheckBox);
this.Controls.Add(this.label1);
this.Controls.Add(this.bandwidthLimitTextBox);
this.Controls.Add(this.bandwidthLabel);
@@ -551,5 +567,6 @@ namespace AndroidSideloader
private System.Windows.Forms.Label bandwidthLabel;
private System.Windows.Forms.TextBox bandwidthLimitTextBox;
private System.Windows.Forms.Label label1;
private System.Windows.Forms.CheckBox hideAdultContentCheckBox;
}
}

View File

@@ -1,4 +1,5 @@
using JR.Utils.GUI.Forms;
using AndroidSideloader.Utilities;
using JR.Utils.GUI.Forms;
using System;
using System.Diagnostics;
using System.IO;
@@ -9,6 +10,7 @@ namespace AndroidSideloader
{
public partial class SettingsForm : Form
{
private static readonly SettingsManager _settings = SettingsManager.Instance;
public SettingsForm()
{
InitializeComponent();
@@ -17,34 +19,34 @@ namespace AndroidSideloader
private void SettingsForm_Load(object sender, EventArgs e)
{
CenterToParent();
intSettings();
intToolTips();
initSettings();
initToolTips();
}
//Init form objects with values from settings
private void intSettings()
private void initSettings()
{
checkForUpdatesCheckBox.Checked = Properties.Settings.Default.checkForUpdates;
enableMessageBoxesCheckBox.Checked = Properties.Settings.Default.enableMessageBoxes;
deleteAfterInstallCheckBox.Checked = Properties.Settings.Default.deleteAllAfterInstall;
updateConfigCheckBox.Checked = Properties.Settings.Default.autoUpdateConfig;
userJsonOnGameInstall.Checked = Properties.Settings.Default.userJsonOnGameInstall;
nodevicemodeBox.Checked = Properties.Settings.Default.nodevicemode;
bmbfBox.Checked = Properties.Settings.Default.BMBFchecked;
AutoReinstBox.Checked = Properties.Settings.Default.AutoReinstall;
trailersOn.Checked = Properties.Settings.Default.TrailersOn;
chkSingleThread.Checked = Properties.Settings.Default.singleThreadMode;
virtualFilesystemCompatibilityCheckbox.Checked = Properties.Settings.Default.virtualFilesystemCompatibility;
bandwidthLimitTextBox.Text = Properties.Settings.Default.bandwidthLimit.ToString();
checkForUpdatesCheckBox.Checked = _settings.CheckForUpdates;
enableMessageBoxesCheckBox.Checked = _settings.EnableMessageBoxes;
deleteAfterInstallCheckBox.Checked = _settings.DeleteAllAfterInstall;
updateConfigCheckBox.Checked = _settings.AutoUpdateConfig;
userJsonOnGameInstall.Checked = _settings.UserJsonOnGameInstall;
nodevicemodeBox.Checked = _settings.NodeviceMode;
bmbfBox.Checked = _settings.BMBFChecked;
AutoReinstBox.Checked = _settings.AutoReinstall;
trailersOn.Checked = _settings.TrailersOn;
chkSingleThread.Checked = _settings.SingleThreadMode;
virtualFilesystemCompatibilityCheckbox.Checked = _settings.VirtualFilesystemCompatibility;
hideAdultContentCheckBox.Checked = _settings.HideAdultContent;
bandwidthLimitTextBox.Text = _settings.BandwidthLimit.ToString();
if (nodevicemodeBox.Checked)
{
deleteAfterInstallCheckBox.Checked = false;
deleteAfterInstallCheckBox.Enabled = false;
}
chkUseDownloadedFiles.Checked = Properties.Settings.Default.useDownloadedFiles;
chkUseDownloadedFiles.Checked = _settings.UseDownloadedFiles;
}
private void intToolTips()
private void initToolTips()
{
ToolTip checkForUpdatesToolTip = new ToolTip();
checkForUpdatesToolTip.SetToolTip(checkForUpdatesCheckBox, "If this is checked, the software will check for available updates");
@@ -58,7 +60,7 @@ namespace AndroidSideloader
public void btnUploadDebug_click(object sender, EventArgs e)
{
if (File.Exists($"{Properties.Settings.Default.CurrentLogPath}"))
if (File.Exists($"{_settings.CurrentLogPath}"))
{
string UUID = SideloaderUtilities.UUID();
string debugLogPath = $"{Environment.CurrentDirectory}\\{UUID}.log";
@@ -71,12 +73,11 @@ namespace AndroidSideloader
}
}
public void btnResetDebug_click(object sender, EventArgs e)
{
if (File.Exists($"{Properties.Settings.Default.CurrentLogPath}"))
if (File.Exists($"{_settings.CurrentLogPath}"))
{
File.Delete($"{Properties.Settings.Default.CurrentLogPath}");
File.Delete($"{_settings.CurrentLogPath}");
}
if (File.Exists($"{Environment.CurrentDirectory}\\debuglog.txt"))
@@ -85,7 +86,6 @@ namespace AndroidSideloader
}
}
//Apply settings
private void applyButton_Click(object sender, EventArgs e)
{
string input = bandwidthLimitTextBox.Text;
@@ -93,8 +93,8 @@ namespace AndroidSideloader
if (regex.IsMatch(input) && float.TryParse(input, out float bandwidthLimit))
{
Properties.Settings.Default.bandwidthLimit = bandwidthLimit;
Properties.Settings.Default.Save();
_settings.BandwidthLimit = bandwidthLimit;
_settings.Save();
this.Close();
}
else
@@ -105,49 +105,60 @@ namespace AndroidSideloader
private void checkForUpdatesCheckBox_CheckedChanged(object sender, EventArgs e)
{
Properties.Settings.Default.checkForUpdates = checkForUpdatesCheckBox.Checked;
Properties.Settings.Default.Save();
_settings.CheckForUpdates = checkForUpdatesCheckBox.Checked;
_settings.Save();
}
private void chkUseDownloadedFiles_CheckedChanged(object sender, EventArgs e)
{
Properties.Settings.Default.useDownloadedFiles = chkUseDownloadedFiles.Checked;
Properties.Settings.Default.Save();
_settings.UseDownloadedFiles = chkUseDownloadedFiles.Checked;
_settings.Save();
}
private void enableMessageBoxesCheckBox_CheckedChanged(object sender, EventArgs e)
{
Properties.Settings.Default.enableMessageBoxes = enableMessageBoxesCheckBox.Checked;
Properties.Settings.Default.Save();
_settings.EnableMessageBoxes = enableMessageBoxesCheckBox.Checked;
_settings.Save();
}
private void resetSettingsButton_Click(object sender, EventArgs e)
{
Properties.Settings.Default.Reset();
Properties.Settings.Default.customDownloadDir = false;
Properties.Settings.Default.customBackupDir = false;
MainForm.backupFolder = Path.Combine(Environment.GetFolderPath(Environment.SpecialFolder.MyDocuments), $"Rookie Backups");
Properties.Settings.Default.downloadDir = Environment.CurrentDirectory.ToString();
Properties.Settings.Default.createPubMirrorFile = true;
intSettings();
Properties.Settings.Default.Save();
// Reset the specific properties
_settings.CustomDownloadDir = false;
_settings.CustomBackupDir = false;
// Set backup folder and download directory
MainForm.backupFolder = Path.Combine(Environment.GetFolderPath(Environment.SpecialFolder.MyDocuments), "Rookie Backups");
_settings.DownloadDir = Environment.CurrentDirectory;
_settings.CreatePubMirrorFile = true;
// Optionally, call initSettings if it needs to initialize anything based on these settings
initSettings();
// Save the updated settings
_settings.Save();
}
private void deleteAfterInstallCheckBox_CheckedChanged(object sender, EventArgs e)
{
Properties.Settings.Default.deleteAllAfterInstall = deleteAfterInstallCheckBox.Checked;
_settings.DeleteAllAfterInstall = deleteAfterInstallCheckBox.Checked;
_settings.Save();
}
private void updateConfigCheckBox_CheckedChanged(object sender, EventArgs e)
{
Properties.Settings.Default.autoUpdateConfig = updateConfigCheckBox.Checked;
if (Properties.Settings.Default.autoUpdateConfig == true) {
Properties.Settings.Default.createPubMirrorFile = true;
_settings.AutoUpdateConfig = updateConfigCheckBox.Checked;
if (_settings.AutoUpdateConfig)
{
_settings.CreatePubMirrorFile = true;
}
_settings.Save();
}
private void userJsonOnGameInstall_CheckedChanged(object sender, EventArgs e)
{
Properties.Settings.Default.userJsonOnGameInstall = userJsonOnGameInstall.Checked;
_settings.UserJsonOnGameInstall = userJsonOnGameInstall.Checked;
_settings.Save();
}
private void SettingsForm_KeyPress(object sender, KeyPressEventArgs e)
@@ -170,6 +181,7 @@ namespace AndroidSideloader
Close();
}
}
protected override bool ProcessDialogKey(Keys keyData)
{
if (Form.ModifierKeys == Keys.None && keyData == Keys.Escape)
@@ -182,38 +194,32 @@ namespace AndroidSideloader
private void nodevicemodeBox_CheckedChanged(object sender, EventArgs e)
{
Properties.Settings.Default.nodevicemode = nodevicemodeBox.Checked;
_settings.NodeviceMode = nodevicemodeBox.Checked;
if (!nodevicemodeBox.Checked)
{
deleteAfterInstallCheckBox.Checked = true;
Properties.Settings.Default.deleteAllAfterInstall = true;
_settings.DeleteAllAfterInstall = true;
deleteAfterInstallCheckBox.Enabled = true;
}
else
{
deleteAfterInstallCheckBox.Checked = false;
Properties.Settings.Default.deleteAllAfterInstall = false;
_settings.DeleteAllAfterInstall = false;
deleteAfterInstallCheckBox.Enabled = false;
}
Properties.Settings.Default.Save();
_settings.Save();
}
private void bmbfBox_CheckedChanged(object sender, EventArgs e)
{
Properties.Settings.Default.BMBFchecked = bmbfBox.Checked;
Properties.Settings.Default.Save();
_settings.BMBFChecked = bmbfBox.Checked;
_settings.Save();
}
private void AutoReinstBox_CheckedChanged(object sender, EventArgs e)
{
Properties.Settings.Default.AutoReinstall = AutoReinstBox.Checked;
Properties.Settings.Default.Save();
}
private void trailersOn_CheckedChanged(object sender, EventArgs e)
{
Properties.Settings.Default.TrailersOn = trailersOn.Checked;
Properties.Settings.Default.Save();
_settings.AutoReinstall = AutoReinstBox.Checked;
_settings.Save();
}
private void AutoReinstBox_Click(object sender, EventArgs e)
@@ -230,7 +236,12 @@ namespace AndroidSideloader
AutoReinstBox.Checked = false;
}
}
}
private void trailersOn_CheckedChanged(object sender, EventArgs e)
{
_settings.TrailersOn = trailersOn.Checked;
_settings.Save();
}
private void btnOpenDebug_Click(object sender, EventArgs e)
@@ -245,9 +256,9 @@ namespace AndroidSideloader
{
if (downloadDirectorySetter.ShowDialog() == DialogResult.OK)
{
Properties.Settings.Default.customDownloadDir = true;
Properties.Settings.Default.downloadDir = downloadDirectorySetter.SelectedPath;
Properties.Settings.Default.Save();
_settings.CustomDownloadDir = true;
_settings.DownloadDir = downloadDirectorySetter.SelectedPath;
_settings.Save();
}
}
@@ -255,33 +266,36 @@ namespace AndroidSideloader
{
if (backupDirectorySetter.ShowDialog() == DialogResult.OK)
{
Properties.Settings.Default.customBackupDir = true;
Properties.Settings.Default.backupDir = backupDirectorySetter.SelectedPath;
MainForm.backupFolder = Properties.Settings.Default.backupDir;
Properties.Settings.Default.Save();
_settings.CustomBackupDir = true;
_settings.BackupDir = backupDirectorySetter.SelectedPath;
MainForm.backupFolder = _settings.BackupDir;
_settings.Save();
}
}
private void chkSingleThread_CheckedChanged(object sender, EventArgs e)
{
Properties.Settings.Default.singleThreadMode = chkSingleThread.Checked;
_settings.SingleThreadMode = chkSingleThread.Checked;
_settings.Save();
}
private void virtualFilesystemCompatibilityCheckbox_CheckedChanged(object sender, EventArgs e)
{
Properties.Settings.Default.virtualFilesystemCompatibility = virtualFilesystemCompatibilityCheckbox.Checked;
Properties.Settings.Default.Save();
_settings.VirtualFilesystemCompatibility = virtualFilesystemCompatibilityCheckbox.Checked;
_settings.Save();
}
private void openDownloadDirectory_Click(object sender, EventArgs e)
{
string pathToOpen = Properties.Settings.Default.customDownloadDir ? $"{Properties.Settings.Default.downloadDir}" : $"{Environment.CurrentDirectory}";
string pathToOpen = _settings.CustomDownloadDir ? _settings.DownloadDir : Environment.CurrentDirectory;
MainForm.OpenDirectory(pathToOpen);
}
private void openBackupDirectory_Click(object sender, EventArgs e)
{
string pathToOpen = Properties.Settings.Default.customBackupDir ? $"{Path.Combine((Properties.Settings.Default.backupDir), $"Rookie Backups")}" : $"{Path.Combine(Environment.GetFolderPath(Environment.SpecialFolder.MyDocuments), $"Rookie Backups")}";
string pathToOpen = _settings.CustomBackupDir
? Path.Combine(_settings.BackupDir, "Rookie Backups")
: Path.Combine(Environment.GetFolderPath(Environment.SpecialFolder.MyDocuments), "Rookie Backups");
MainForm.OpenDirectory(pathToOpen);
}
@@ -297,6 +311,11 @@ namespace AndroidSideloader
e.Handled = true;
}
}
}
}
private void hideAdultContentCheckBox_CheckedChanged(object sender, EventArgs e)
{
_settings.HideAdultContent = hideAdultContentCheckBox.Checked;
_settings.Save();
}
}
}

View File

@@ -7,11 +7,13 @@ using System.Net;
using System.Text.RegularExpressions;
using System.Drawing;
using System.Windows.Forms;
using AndroidSideloader.Utilities;
namespace AndroidSideloader
{
internal class Sideloader
{
private static readonly SettingsManager settings = SettingsManager.Instance;
public static string TempFolder = Path.Combine(Environment.CurrentDirectory, "temp");
public static string CrashLogPath = "crashlog.txt";
@@ -87,8 +89,8 @@ namespace AndroidSideloader
string replacement = "";
string pattern = "adb";
replacement = ADB.DeviceID.Length > 1
? $"{Properties.Settings.Default.ADBPath} -s {ADB.DeviceID}"
: $"{Properties.Settings.Default.ADBPath}";
? $"{settings.ADBPath} -s {ADB.DeviceID}"
: $"{settings.ADBPath}";
Regex rgx = new Regex(pattern);
string result = rgx.Replace(cmd, replacement);
Program.form.changeTitle($"Running {result}");
@@ -165,13 +167,13 @@ namespace AndroidSideloader
public static void BackupGame(string packagename)
{
if (!Properties.Settings.Default.customBackupDir)
if (!settings.CustomBackupDir)
{
MainForm.backupFolder = Path.Combine(Environment.GetFolderPath(Environment.SpecialFolder.MyDocuments), $"Rookie Backups");
}
else
{
MainForm.backupFolder = Path.Combine((Properties.Settings.Default.backupDir), $"Rookie Backups");
MainForm.backupFolder = Path.Combine((settings.BackupDir), $"Rookie Backups");
}
if (!Directory.Exists(MainForm.backupFolder))
{
@@ -219,26 +221,26 @@ namespace AndroidSideloader
apkPath = apkPath.Remove(apkPath.Length - 1);
apkPath = apkPath.Remove(0, 8); //remove package:
apkPath = apkPath.Remove(apkPath.Length - 1);
if (File.Exists($"{Properties.Settings.Default.ADBFolder}\\base.apk"))
if (File.Exists($"{settings.ADBFolder}\\base.apk"))
{
File.Delete($"{Properties.Settings.Default.ADBFolder}\\base.apk");
File.Delete($"{settings.ADBFolder}\\base.apk");
}
if (File.Exists($"{Properties.Settings.Default.MainDir}\\{packageName}\\{packageName}.apk"))
if (File.Exists($"{settings.MainDir}\\{packageName}\\{packageName}.apk"))
{
File.Delete($"{Properties.Settings.Default.MainDir}\\{packageName}\\{packageName}.apk");
File.Delete($"{settings.MainDir}\\{packageName}\\{packageName}.apk");
}
output += ADB.RunAdbCommandToString("pull " + apkPath); //pull apk
if (Directory.Exists($"{Properties.Settings.Default.MainDir}\\{packageName}"))
if (Directory.Exists($"{settings.MainDir}\\{packageName}"))
{
Directory.Delete($"{Properties.Settings.Default.MainDir}\\{packageName}", true);
Directory.Delete($"{settings.MainDir}\\{packageName}", true);
}
_ = Directory.CreateDirectory($"{Properties.Settings.Default.MainDir}\\{packageName}");
_ = Directory.CreateDirectory($"{settings.MainDir}\\{packageName}");
File.Move($"{Properties.Settings.Default.ADBFolder}\\base.apk", $"{Properties.Settings.Default.MainDir}\\{packageName}\\{packageName}.apk");
File.Move($"{settings.ADBFolder}\\base.apk", $"{settings.MainDir}\\{packageName}\\{packageName}.apk");
return output;
}

View File

@@ -94,6 +94,14 @@ namespace AndroidSideloader
client.DownloadFile("https://github.com/VRPirates/rookie/raw/master/CleanupInstall.cmd", "CleanupInstall.cmd");
_ = Logger.Log($"'CleanupInstall.cmd' download successful");
}
if (!File.Exists("AddDefenderExceptions.ps1"))
{
currentAccessedWebsite = "github";
_ = Logger.Log($"Missing 'AddDefenderExceptions.ps1'. Attempting to download from {currentAccessedWebsite}");
client.DownloadFile("https://github.com/VRPirates/rookie/raw/master/AddDefenderExceptions.ps1", "AddDefenderExceptions.ps1");
_ = Logger.Log($"'AddDefenderExceptions.ps1' download successful");
}
}
catch (Exception ex)
{
@@ -124,7 +132,7 @@ namespace AndroidSideloader
Application.Exit();
}
string wantedRcloneVersion = "1.67.0";
string wantedRcloneVersion = "1.68.2";
bool rcloneSuccess = false;
rcloneSuccess = downloadRclone(wantedRcloneVersion, false);
@@ -180,6 +188,18 @@ namespace AndroidSideloader
if (updateRclone == true)
{
// Preserve vrp.download.config if it exists
string configPath = Path.Combine(dirRclone, "vrp.download.config");
string tempConfigPath = Path.Combine(Environment.CurrentDirectory, "vrp.download.config.bak");
bool hasConfig = false;
if (File.Exists(configPath))
{
_ = Logger.Log("Preserving vrp.download.config before update");
File.Copy(configPath, tempConfigPath, true);
hasConfig = true;
}
MainForm.SplashScreen.UpdateBackgroundImage(AndroidSideloader.Properties.Resources.splashimage_rclone);
string architecture = Environment.Is64BitOperatingSystem ? "amd64" : "386";
@@ -212,6 +232,13 @@ namespace AndroidSideloader
}
Directory.Delete(dirExtractedRclone, true);
// Restore vrp.download.config if it was backed up
if (hasConfig && File.Exists(tempConfigPath))
{
_ = Logger.Log("Restoring vrp.download.config after update");
File.Move(tempConfigPath, configPath);
}
_ = Logger.Log($"rclone download successful");
}

View File

@@ -1,4 +1,5 @@
using System;
using AndroidSideloader.Utilities;
using System;
using System.IO;
using System.Management;
using System.Security.Cryptography;
@@ -8,6 +9,7 @@ namespace AndroidSideloader
{
internal class SideloaderUtilities
{
private static readonly SettingsManager settings = SettingsManager.Instance;
public static bool CheckFolderIsObb(string path)
{
string[] files = Directory.GetFiles(path);
@@ -26,7 +28,7 @@ namespace AndroidSideloader
private static string uuid = null;
public static string UUID()
{
uuid = Properties.Settings.Default.UUID;
uuid = settings.UUID;
if (string.IsNullOrEmpty(uuid) != true)
{
return uuid;
@@ -40,8 +42,8 @@ namespace AndroidSideloader
uuid = BitConverter.ToString(bytes).Replace("-", "");
Properties.Settings.Default.UUID = uuid;
Properties.Settings.Default.Save();
settings.UUID = uuid;
settings.Save();
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.30.0";
public static readonly string LocalVersion = "2.33.0";
public static string currentVersion = string.Empty;
public static string changelog = string.Empty;

View File

@@ -1,4 +1,5 @@
using System;
using AndroidSideloader.Utilities;
using System;
using System.IO;
using System.Text;
@@ -16,14 +17,60 @@ namespace AndroidSideloader
public static class Logger
{
private static readonly SettingsManager settings = SettingsManager.Instance;
private static readonly object lockObject = new object();
private static string logFilePath = Properties.Settings.Default.CurrentLogPath;
private static string logFilePath = settings.CurrentLogPath;
public static void Initialize()
{
try
{
// Set default log path if not already set
if (string.IsNullOrEmpty(logFilePath))
{
logFilePath = Path.Combine(Environment.CurrentDirectory, "debuglog.txt");
}
// Create directory if it doesn't exist
string logDirectory = Path.GetDirectoryName(logFilePath);
if (!string.IsNullOrEmpty(logDirectory) && !Directory.Exists(logDirectory))
{
Directory.CreateDirectory(logDirectory);
}
// Create log file if it doesn't exist
if (!File.Exists(logFilePath))
{
using (FileStream fs = File.Create(logFilePath))
{
// Create empty file
}
}
// Update settings with log path
settings.CurrentLogPath = logFilePath;
settings.Save();
// Initial log entry
Log($"Logger initialized at: {DateTime.Now:hh:mmtt(UTC)}", LogLevel.INFO);
}
catch (Exception ex)
{
Console.WriteLine($"Error initializing logger: {ex.Message}");
}
}
public static bool Log(string text, LogLevel logLevel = LogLevel.INFO, bool ret = true)
{
if (string.IsNullOrWhiteSpace(text) || text.Length <= 5)
return ret;
// Initialize logger if not already initialized
if (string.IsNullOrEmpty(logFilePath))
{
Initialize();
}
string time = DateTime.UtcNow.ToString("hh:mm:ss.fff tt (UTC): ");
string newline = text.Length > 40 && text.Contains("\n") ? "\n\n" : "\n";
string logEntry = time + "[" + logLevel.ToString().ToUpper() + "] [" + GetCallerInfo() + "] " + text + newline;
@@ -35,9 +82,9 @@ namespace AndroidSideloader
File.AppendAllText(logFilePath, logEntry);
}
}
catch
catch (Exception ex)
{
// Handle the exception if necessary
Console.WriteLine($"Error writing to log: {ex.Message}");
}
return ret;

View File

@@ -0,0 +1,292 @@
using Newtonsoft.Json;
using Newtonsoft.Json.Linq;
using System;
using System.Diagnostics;
using System.Drawing;
using System.IO;
using System.Linq;
namespace AndroidSideloader.Utilities
{
public class SettingsManager : IDisposable
{
private static readonly Lazy<SettingsManager> _instance = new Lazy<SettingsManager>(() => new SettingsManager());
private static readonly string settingsFilePath = Path.Combine(
Environment.CurrentDirectory,
"settings.json");
// Custom converters for special types
public class FontConverter : JsonConverter<Font>
{
public override Font ReadJson(JsonReader reader, Type objectType, Font existingValue, bool hasExistingValue, JsonSerializer serializer)
{
var jo = JObject.Load(reader);
string fontFamily = jo["FontFamily"]?.Value<string>() ?? "Microsoft Sans Serif";
float fontSize = jo["Size"]?.Value<float>() ?? 11.25f;
return new Font(fontFamily, fontSize);
}
public override void WriteJson(JsonWriter writer, Font value, JsonSerializer serializer)
{
writer.WriteStartObject();
writer.WritePropertyName("FontFamily");
writer.WriteValue(value.FontFamily.Name);
writer.WritePropertyName("Size");
writer.WriteValue(value.Size);
writer.WriteEndObject();
}
}
public class ColorConverter : JsonConverter<Color>
{
public override Color ReadJson(JsonReader reader, Type objectType, Color existingValue, bool hasExistingValue, JsonSerializer serializer)
{
var jo = JObject.Load(reader);
int a = jo["A"]?.Value<int>() ?? 255;
int r = jo["R"]?.Value<int>() ?? 0;
int g = jo["G"]?.Value<int>() ?? 0;
int b = jo["B"]?.Value<int>() ?? 0;
return Color.FromArgb(a, r, g, b);
}
public override void WriteJson(JsonWriter writer, Color value, JsonSerializer serializer)
{
writer.WriteStartObject();
writer.WritePropertyName("A");
writer.WriteValue(value.A);
writer.WritePropertyName("R");
writer.WriteValue(value.R);
writer.WritePropertyName("G");
writer.WriteValue(value.G);
writer.WritePropertyName("B");
writer.WriteValue(value.B);
writer.WriteEndObject();
}
}
[JsonConverter(typeof(FontConverter))]
public Font FontStyle { get; set; } = new Font("Microsoft Sans Serif", 11.25f);
[JsonConverter(typeof(FontConverter))]
public Font BigFontStyle { get; set; } = new Font("Microsoft Sans Serif", 14f);
[JsonConverter(typeof(ColorConverter))]
public Color FontColor { get; set; } = Color.White;
[JsonConverter(typeof(ColorConverter))]
public Color ComboBoxColor { get; set; } = Color.FromArgb(25, 25, 25);
[JsonConverter(typeof(ColorConverter))]
public Color SubButtonColor { get; set; } = Color.FromArgb(25, 25, 25);
[JsonConverter(typeof(ColorConverter))]
public Color TextBoxColor { get; set; } = Color.FromArgb(25, 25, 25);
[JsonConverter(typeof(ColorConverter))]
public Color ButtonColor { get; set; } = Color.Black;
[JsonConverter(typeof(ColorConverter))]
public Color BackColor { get; set; } = Color.FromArgb(1, 1, 1);
public bool CheckForUpdates { get; set; } = true;
public bool EnableMessageBoxes { get; set; } = true;
public bool FirstRun { get; set; } = true;
public bool DeleteAllAfterInstall { get; set; } = true;
public bool AutoUpdateConfig { get; set; } = true;
public bool UserJsonOnGameInstall { get; set; } = false;
public bool CallUpgrade { get; set; } = true;
public string BackPicturePath { get; set; } = string.Empty;
public bool SpoofGames { get; set; } = false;
public bool ResignAPKs { get; set; } = false;
public string IPAddress { get; set; } = string.Empty;
public string InstalledApps { get; set; } = string.Empty;
public string ADBPath { get; set; } = string.Empty;
public string MainDir { get; set; } = string.Empty;
public bool Delsh { get; set; } = false;
public string CurrPckg { get; set; } = string.Empty;
public string ADBFolder { get; set; } = string.Empty;
public bool WirelessADB { get; set; } = false;
public string CurrentGamename { get; set; } = string.Empty;
public bool PackageNameToCB { get; set; } = false;
public bool DownUpHeld { get; set; } = false;
public string CurrentLogPath { get; set; } = string.Empty;
public string CurrentLogName { get; set; } = string.Empty;
public string CurrentCrashPath { get; set; } = string.Empty;
public string CurrentCrashName { get; set; } = string.Empty;
public bool AdbDebugWarned { get; set; } = false;
public bool NodeviceMode { get; set; } = false;
public bool BMBFChecked { get; set; } = true;
public string GamesList { get; set; } = string.Empty;
public bool UploadedGameList { get; set; } = false;
public string GlobalUsername { get; set; } = string.Empty;
public DateTime LastTimeShared { get; set; } = new DateTime(1969, 4, 20, 16, 20, 0);
public bool AutoReinstall { get; set; } = false;
public string NonAppPackages { get; set; } = string.Empty;
public DateTime LastLaunch { get; set; } = new DateTime(1969, 4, 20, 16, 20, 0);
public string SubmittedUpdates { get; set; } = string.Empty;
public bool ListUpped { get; set; } = false;
public DateTime LastLaunch2 { get; set; } = new DateTime(1969, 4, 20, 16, 20, 0);
public bool Wired { get; set; } = false;
public string AppPackages { get; set; } = string.Empty;
public bool TrailersOn { get; set; } = false;
public string DownloadDir { get; set; } = string.Empty;
public bool CustomDownloadDir { get; set; } = false;
public bool CustomBackupDir { get; set; } = false;
public string BackupDir { get; set; } = string.Empty;
public bool SingleThreadMode { get; set; } = true;
public bool VirtualFilesystemCompatibility { get; set; } = false;
public bool UpdateSettings { get; set; } = true;
public string UUID { get; set; } = Guid.NewGuid().ToString();
public bool CreatePubMirrorFile { get; set; } = true;
public bool UseDownloadedFiles { get; set; } = false;
public float BandwidthLimit { get; set; } = 0f;
public bool HideAdultContent { get; set; } = false;
public string[] FavoritedGames { get; set; } = new string[0];
private SettingsManager()
{
Load();
Save();
}
public static SettingsManager Instance => _instance.Value;
public void Save()
{
try
{
var settings = new JsonSerializerSettings
{
Formatting = Formatting.Indented,
ReferenceLoopHandling = ReferenceLoopHandling.Ignore
};
var json = JsonConvert.SerializeObject(this, settings);
File.WriteAllText(settingsFilePath, json);
}
catch (Exception ex)
{
Console.WriteLine($"Error saving settings: {ex.Message}");
}
}
private void Load()
{
Debug.WriteLine("Loading settings...");
if (!File.Exists(settingsFilePath))
{
CreateDefaultSettings();
return;
}
try
{
var json = File.ReadAllText(settingsFilePath);
var settings = new JsonSerializerSettings
{
Error = (sender, args) =>
{
Debug.WriteLine($"Error deserializing setting: {args.ErrorContext.Error.Message}");
args.ErrorContext.Handled = true;
}
};
JsonConvert.PopulateObject(json, this, settings);
}
catch (Exception ex)
{
Debug.WriteLine($"Error loading settings: {ex.Message}");
CreateDefaultSettings();
}
}
private void CreateDefaultSettings()
{
FontStyle = new Font("Microsoft Sans Serif", 11.25f);
BigFontStyle = new Font("Microsoft Sans Serif", 14f);
FontColor = Color.White;
ComboBoxColor = Color.FromArgb(25, 25, 25);
SubButtonColor = Color.FromArgb(25, 25, 25);
TextBoxColor = Color.FromArgb(25, 25, 25);
ButtonColor = Color.Black;
BackColor = Color.FromArgb(1, 1, 1);
CheckForUpdates = true;
EnableMessageBoxes = true;
FirstRun = true;
DeleteAllAfterInstall = true;
AutoUpdateConfig = true;
UserJsonOnGameInstall = false;
CallUpgrade = true;
BackPicturePath = string.Empty;
SpoofGames = false;
ResignAPKs = false;
IPAddress = string.Empty;
InstalledApps = string.Empty;
ADBPath = string.Empty;
MainDir = string.Empty;
Delsh = false;
CurrPckg = string.Empty;
ADBFolder = string.Empty;
WirelessADB = false;
CurrentGamename = string.Empty;
PackageNameToCB = false;
DownUpHeld = false;
CurrentLogPath = string.Empty;
CurrentLogName = string.Empty;
CurrentCrashPath = string.Empty;
CurrentCrashName = string.Empty;
AdbDebugWarned = false;
NodeviceMode = false;
BMBFChecked = true;
GamesList = string.Empty;
UploadedGameList = false;
GlobalUsername = string.Empty;
LastTimeShared = new DateTime(1969, 4, 20, 16, 20, 0);
AutoReinstall = false;
NonAppPackages = string.Empty;
LastLaunch = new DateTime(1969, 4, 20, 16, 20, 0);
SubmittedUpdates = string.Empty;
ListUpped = false;
LastLaunch2 = new DateTime(1969, 4, 20, 16, 20, 0);
Wired = false;
AppPackages = string.Empty;
TrailersOn = false;
DownloadDir = string.Empty;
CustomDownloadDir = false;
CustomBackupDir = false;
BackupDir = string.Empty;
SingleThreadMode = true;
VirtualFilesystemCompatibility = false;
UpdateSettings = true;
UUID = Guid.NewGuid().ToString();
CreatePubMirrorFile = true;
UseDownloadedFiles = false;
BandwidthLimit = 0f;
HideAdultContent = false;
FavoritedGames = new string[0];
Save();
Debug.WriteLine("Default settings created.");
}
public void AddFavoriteGame(string packageName)
{
if (!FavoritedGames.Contains(packageName))
{
var list = FavoritedGames.ToList();
list.Add(packageName);
FavoritedGames = list.ToArray();
Save();
}
}
public void RemoveFavoriteGame(string packageName)
{
if (FavoritedGames.Contains(packageName))
{
var list = FavoritedGames.ToList();
list.Remove(packageName);
FavoritedGames = list.ToArray();
Save();
}
}
public void Dispose()
{
FontStyle?.Dispose();
BigFontStyle?.Dispose();
}
}
}

View File

@@ -18,6 +18,7 @@ namespace AndroidSideloader.Utilities
internal class Zip
{
private static readonly SettingsManager settings = SettingsManager.Instance;
public static void ExtractFile(string sourceArchive, string destination)
{
string args = $"x \"{sourceArchive}\" -y -o\"{destination}\" -bsp1";
@@ -101,7 +102,7 @@ namespace AndroidSideloader.Utilities
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.",
_ = FlexibleMessageBox.Show(Program.form, $"Not enough space to extract archive.\r\nMake sure your {Path.GetPathRoot(settings.DownloadDir)} drive has at least double the space of the game, then try again.",
"NOT ENOUGH SPACE",
MessageBoxButtons.OK,
MessageBoxIcon.Error);

22
build.cmd Normal file
View File

@@ -0,0 +1,22 @@
@echo off
REM Default to Release if no argument is provided
SET CONFIG=Release
IF NOT "%1"=="" (
IF /I "%1"=="debug" SET CONFIG=Debug
)
REM Windows Batch script version
REM Attempts to find MSBuild from common Visual Studio 2022 installation paths
IF EXIST "C:\Program Files\Microsoft Visual Studio\2022\Community\MSBuild\Current\Bin\MSBuild.exe" (
SET MSBUILD="C:\Program Files\Microsoft Visual Studio\2022\Community\MSBuild\Current\Bin\MSBuild.exe"
) ELSE IF EXIST "C:\Program Files\Microsoft Visual Studio\2022\Professional\MSBuild\Current\Bin\MSBuild.exe" (
SET MSBUILD="C:\Program Files\Microsoft Visual Studio\2022\Professional\MSBuild\Current\Bin\MSBuild.exe"
) ELSE IF EXIST "C:\Program Files\Microsoft Visual Studio\2022\Enterprise\MSBuild\Current\Bin\MSBuild.exe" (
SET MSBUILD="C:\Program Files\Microsoft Visual Studio\2022\Enterprise\MSBuild\Current\Bin\MSBuild.exe"
) ELSE (
echo MSBuild not found! Please check your Visual Studio installation.
exit /b 1
)
echo Building in %CONFIG% configuration...
%MSBUILD% AndroidSideloader.sln /t:AndroidSideloader /p:Configuration=%CONFIG%

View File

@@ -1,30 +1,5 @@
RSL 2.30
RSL 2.33
- Feature: Added Download Metrics
-- Upon downloading a game, Rookie will attempt to log the download count with our server
-- No additional data is collected except for the Package Name and VersionCode of the Game being downloaded
- Feature: Added Downloads column to Gamelist
-- Downloads counts are updated nightly
- Feature: Added "Send Command" button to ADB Commands prompt (Enter still works)
- Feature: Small changes to how the Upload Mirror works
-- Rookie can now verify game uploads are successful
- Feature: Add Cleanup Install script
- Feature: Added additional Splashes to indicate loading status
- Feature: Added setting to supress Re-Download prompt
- Feature: Added "Disable Checking for New Apps" argument (for Testers sanity)
- Feature: Added Bandwidth Limiter to Settings
- Fix: Fixes for using Sponsored Mirrors
-- Eliminated downloading of vrp.download.config from the wiki
-- Fixed issue where Rookie would check for the mirror before it was loaded in
- Fix: Add quotes around all ADB path commands
- Fix: Public Mirror label not displaying
- Fix: Allow spaces when setting username
- Fix: Prevent Rookie from constantly prompting for the Public Config
- Fix: Fixed issue where the Game List doesn't copy/export properly
- Fix: Fixed issue where dropping an entire folder doesn't read the install.txt
- Chore: Remove random mirror picker (no longer used)
- Chore: Changed unable to connect message
- Chore: Remove Offline Mode popup
- Chore: Remove unused dependencies
- Chore: Rename random assets
- Chore: Bump rclone to 1.67.0 (from 1.66.0)
- [Feature] Allow users to cancel backups
- [QoL] Lower ADB Version
- [QoL] Revert Add saving the ColumnWidths, Window Sizes/Position

Binary file not shown.

View File

@@ -1 +1 @@
2.30.0
2.33.0