From 3e67b331ef7aed3a455fedd602802689c4738135 Mon Sep 17 00:00:00 2001 From: William Swartwood Date: Thu, 19 Aug 2021 02:23:43 -0400 Subject: [PATCH] Autoupload WITHOUT new game detection (for live release) --- ChangelogHistory.txt | 43 +++++++++++++++++++++++++ MainForm.cs | 70 ++++++++++++++++++++--------------------- Sideloader/RCLONE.cs | 2 ++ Updater.cs | 2 +- Utilities/UploadGame.cs | 6 ++++ changelog.txt | 40 +++++++++++------------ version | 2 +- 7 files changed, 107 insertions(+), 58 deletions(-) diff --git a/ChangelogHistory.txt b/ChangelogHistory.txt index 02f3d5eb..8636e7af 100644 --- a/ChangelogHistory.txt +++ b/ChangelogHistory.txt @@ -1,6 +1,49 @@ -----BEGIN PGP SIGNED MESSAGE----- Hash: SHA256 +RSL 2.8.2 + ++ Added automatic upload to Google shared drive +for clean game files donation. ++ Added uploading GIF for duration of upload. ++ Added warning messages when user attempts +to close Rookie while games are download, installing, +or uploading. += Threaded clean file zipping and uploading +so user can continue to use Rookie while game +is uploading. + + +P.S. We are looking for volunteers for the next +beta which will automatically detect new games +installed on user's headset and suggest them for +donation. Message https://t.me/Harryeffinpotter or +https://t.me/pmowpmow on Telegram to join the beta +test! + +HFP + +-----BEGIN PGP SIGNATURE----- + +iQIzBAEBCAAdFiEEKjgtlwMyrpVu4TGfx/Rql1VoczcFAmEd+IUACgkQx/Rql1Vo +czcyUw/+ImynsE4CXmv+LjuTH1by6L2AHZFZCQ0cgwq88OOwdir/WzPfNeqqv0e6 +/QCRbRdvC6pASPgHryCkvFPFXUoLgQ+lXZY1GCBUzX0lIMqrenihQ5QUQb70LOxR +kVkivnxLJzBeQAXn+gkvPXMCIn3l0yVInsjtusVqVHtmsegcAQTwcrG7RXSsl0dr +2rkPOuvlcxMTWA4SlE16IhuLcq8L9GavpeWKoQiaoydhBGdzfAe1O4yy6UQs7Nas +9Xl3vy1mXnZIprTOtjH+zYXxcdcxb1ZAdvHdq19nqTf5iuCqO+A4TxSq4vRv6Dvt +XkJ0igXJsscpIQjJ812mZACJiJlP31yPdhZvKZXtUAQoR63iRPiEpY2gIKrd249Y +HIq0g+XaO0K8kjOAmrBxLpESEBEovhhcfvrepSh7NocsxRAAnxOJUdcbmekwRjpj +MCtMYThTYRXoR2aWxIbtaviUIecAGxuF8m+wWbxnWqJSEh4BanmQKjoh32G8geEE +PS4XMBcWQ0/MhKSibaWO0SQCjrHNtsmbVvu28rh/eD9ar4Z9tPxza43iqSepSEjK +Vlka7WxpkeqVCYnTpoLPv7I+XBBRojKlUp8aUz4MrOuuzNg08GyLFgKejU1aiw4I +7s3PjFj6e4SsRgAKHhKStjYzVTkhlbyWIguhyPdzpiNoMFEwMz8= +=EIFi +-----END PGP SIGNATURE----- + + +-----BEGIN PGP SIGNED MESSAGE----- +Hash: SHA256 + RSL 2.8.1 = Fixed crash at startup related to Upload Date column. diff --git a/MainForm.cs b/MainForm.cs index f47b2514..1c0c1024 100644 --- a/MainForm.cs +++ b/MainForm.cs @@ -1250,40 +1250,54 @@ private async void initListView() GameList.Add(Game); } - foreach(string newGamesToUpload in newGamesList) - { - string RlsName = Sideloader.PackageNametoGameName(newGamesToUpload); - string GameName = Sideloader.gameNameToSimpleName(RlsName); - - DialogResult dialogResult = FlexibleMessageBox.Show($"You have a new game:\n\n{GameName}\n\nRSL can AUTOMATICALLY UPLOAD the clean files to a shared drive in the background,\nthis is the only way to keep the apps up to date for everyone.\n\nNOTE: Rookie will only extract the APK/OBB which contain NO personal information whatsoever.", "CONTRIBUTE CLEAN FILES?", MessageBoxButtons.YesNo); - if (dialogResult == DialogResult.Yes) - { - string InstalledVersionCode; - InstalledVersionCode = ADB.RunAdbCommandToString($"shell \"dumpsys package {newGamesToUpload} | grep versionCode -F\"").Output; - InstalledVersionCode = Utilities.StringUtilities.RemoveEverythingBeforeFirst(InstalledVersionCode, "versionCode="); - InstalledVersionCode = Utilities.StringUtilities.RemoveEverythingAfterFirst(InstalledVersionCode, " "); - ulong installedVersionInt = UInt64.Parse(Utilities.StringUtilities.KeepOnlyNumbers(InstalledVersionCode)); - await uploadGameAsync(GameName, newGamesToUpload, installedVersionInt); - } - } - newGamesList.Clear(); + ListViewItem[] arr = GameList.ToArray(); gamesListView.BeginUpdate(); gamesListView.Items.AddRange(arr); gamesListView.EndUpdate(); + // foreach (string newGamesToUpload in newGamesList) + // { + // string RlsName = Sideloader.PackageNametoGameName(newGamesToUpload); + // string GameName = Sideloader.gameNameToSimpleName(RlsName); + //Logger.Log(newGamesToUpload); + // if (!updatesnotified) + //{ + // DialogResult dialogResult = FlexibleMessageBox.Show($"You have a new game:\n\n{GameName}\n\nRSL can AUTOMATICALLY UPLOAD the clean files to a shared drive in the background,\nthis is the only way to keep the apps up to date for everyone.\n\nNOTE: Rookie will only extract the APK/OBB which contain NO personal information whatsoever.", "CONTRIBUTE CLEAN FILES?", MessageBoxButtons.YesNo); + // if (dialogResult == DialogResult.Yes) + // { + // string InstalledVersionCode; + // InstalledVersionCode = ADB.RunAdbCommandToString($"shell \"dumpsys package {newGamesToUpload} | grep versionCode -F\"").Output; + //InstalledVersionCode = Utilities.StringUtilities.RemoveEverythingBeforeFirst(InstalledVersionCode, "versionCode="); + //InstalledVersionCode = Utilities.StringUtilities.RemoveEverythingAfterFirst(InstalledVersionCode, " "); + //ulong installedVersionInt = UInt64.Parse(Utilities.StringUtilities.KeepOnlyNumbers(InstalledVersionCode)); + //await uploadGameAsync(GameName, newGamesToUpload, installedVersionInt); + // } + //} + // } + newGamesList.Clear(); updatesnotified = true; - if (gamesToUpload.Count > 0) + if (!isworking && gamesToUpload.Count > 0) { ChangeTitle("Uploading to shared drive, you can continue to use Rookie while it uploads in the background."); ULGif.Visible = true; ULLabel.Visible = true; ULGif.Enabled = true; + isworking = true; foreach (UploadGame game in gamesToUpload) { Thread t3 = new Thread(() => { + string packagename = Sideloader.gameNameToPackageName(game.Uploadgamename); + if (File.Exists($"{Properties.Settings.Default.MainDir}\\{game.Uploadgamename} v{game.Uploadversion}.zip")) + File.Delete($"{Properties.Settings.Default.MainDir}\\{game.Uploadgamename} v{game.Uploadversion}.zip"); + string path = $"{Properties.Settings.Default.MainDir}\\7z.exe"; + string cmd = $"7z a \"{game.Uploadgamename} v{game.Uploadversion}.zip\" .\\{game.Pckgcommand}\\*"; + ChangeTitle("Zipping extracted application..."); + ADB.RunCommandToString(cmd, path); + Directory.Delete($"{Properties.Settings.Default.MainDir}\\{game.Pckgcommand}", true); + ChangeTitle("Uploading to drive, you may continue to use Rookie while it uploads."); RCLONE.runRcloneCommand(game.Uploadcommand); FlexibleMessageBox.Show($"Upload of {game.Uploadgamename} is complete! Thank you for your contribution!"); File.Delete($"{Properties.Settings.Default.MainDir}\\{game.Uploadgamename} v{game.Uploadversion}.zip"); @@ -1298,7 +1312,7 @@ private async void initListView() } } gamesToUpload.Clear(); - + isworking = false; isuploading = false; ULGif.Visible = false; ULLabel.Visible = false; @@ -1329,27 +1343,11 @@ private async Task uploadGameAsync(string GameName, string packagename, ulong in while (t2.IsAlive) await Task.Delay(1000); - ChangeTitle("Zipping extracted application..."); string HWID = SideloaderUtilities.UUID(); File.WriteAllText($"{Properties.Settings.Default.MainDir}\\{packagename}\\HWID.txt", HWID); - string cmd = $"7z a \"{GameName} v{installedVersionInt}.zip\" .\\{packagename}\\*"; - string path = $"{Properties.Settings.Default.MainDir}\\7z.exe"; progressBar.Style = ProgressBarStyle.Continuous; - isworking = true; - if (File.Exists($"{Properties.Settings.Default.MainDir}\\{GameName} v{installedVersionInt}.zip")) - File.Delete($"{Properties.Settings.Default.MainDir}\\{GameName} v{installedVersionInt}.zip"); - Thread t4 = new Thread(() => - { - ADB.RunCommandToString(cmd, path); - }); - t4.IsBackground = true; - t4.Start(); - while (t4.IsAlive) - await Task.Delay(100); - isworking = false; - Directory.Delete($"{Properties.Settings.Default.MainDir}\\{packagename}", true); - UploadGame game = new UploadGame(); + game.Pckgcommand = packagename; game.Uploadcommand = $"copy \"{Properties.Settings.Default.MainDir}\\{GameName} v{installedVersionInt}.zip\" RSL-debuglogs:CleanGames"; game.Uploadversion = installedVersionInt; game.Uploadgamename = GameName; diff --git a/Sideloader/RCLONE.cs b/Sideloader/RCLONE.cs index 6331a7d3..45c36f6a 100644 --- a/Sideloader/RCLONE.cs +++ b/Sideloader/RCLONE.cs @@ -83,6 +83,8 @@ public static void RefreshRemotes() public static void initGames(string remote) { + if (remote.Contains("08")) + Program.form.SwitchMirrors(); gameProperties.Clear(); games.Clear(); string tempGameList = RCLONE.runRcloneCommand($"cat \"{remote}:{RcloneGamesFolder}/GameList.txt\"").Output; diff --git a/Updater.cs b/Updater.cs index e20418da..5ac895f6 100644 --- a/Updater.cs +++ b/Updater.cs @@ -17,7 +17,7 @@ class Updater private static string RawGitHubUrl; private static string GitHubUrl; - static readonly public string LocalVersion = "2.8.1"; + static readonly public string LocalVersion = "2.8.2"; public static string currentVersion = string.Empty; public static string changelog = string.Empty; diff --git a/Utilities/UploadGame.cs b/Utilities/UploadGame.cs index 33c6991e..b6abc565 100644 --- a/Utilities/UploadGame.cs +++ b/Utilities/UploadGame.cs @@ -13,6 +13,12 @@ public string Uploadcommand { get => uploadcommand; set => uploadcommand = value; + } + private string pckgcommand; + public string Pckgcommand + { + get => pckgcommand; + set => pckgcommand = value; } private string uploadgamename; public string Uploadgamename diff --git a/changelog.txt b/changelog.txt index aa2794ce..33befdcf 100644 --- a/changelog.txt +++ b/changelog.txt @@ -1,26 +1,26 @@ ------BEGIN PGP SIGNED MESSAGE----- -Hash: SHA256 -RSL 2.8.1 +RSL 2.8.2 -= Fixed crash at startup related to Upload Date column. ++ Added automatic upload to Google shared drive +for clean game files donation. ++ Added uploading GIF for duration of upload. ++ Added warning messages when user attempts +to close Rookie while games are download, installing, +or uploading. += Threaded clean file zipping and uploading +so user can continue to use Rookie while game +is uploading. + + +P.S. We are looking for volunteers for the next +beta which will automatically detect new games +installed on user's headset and suggest them for +donation. Message https://t.me/Harryeffinpotter or +https://t.me/pmowpmow on Telegram to join the beta +test! HFP ------BEGIN PGP SIGNATURE----- - -iQIzBAEBCAAdFiEEKjgtlwMyrpVu4TGfx/Rql1VoczcFAmEZPjAACgkQx/Rql1Vo -czdfUw/+PiQ03p3FFwuVIndiDHKvwcjcewDWASYiP2KJkDCsbaEj0U5+ntpu7mxo -ytIFuNZd47CwiYGFXi6IzEO1n9yj4LL3ONnVEogZgd3bP3Bb2b28KDdHtDX3IO5d -wWle/WMksKDywqRyjJnaP9dh+7YS0C/49H32cFokF8S69stPwPYh9LSaf4ctK0/f -y8pHN7tgOkmCR8NU6lOY9OLepBZlv+PcOAco0nIz1zHtwdRGz2vjwQqAa8NShfEy -E/rjBhM37YBULf7cOayt0FY/rDYvw6Bj8B9ht0Bn6dmWgJrhfAj01utREL8HcmPd -rNDXB7UxuR56OVy1f1gh1Fzb5f62xDydfELd/0dFYE0oDcdkHjaEkT5CnAukBmrO -y0ntjawsy40dVAwPwPSAPQ+qP9g7mDZdbjOfgP4JNFWwnxgYLlTASoUMis/hd5mg -FLaFAiMM3o72Gip+gjMl3AiuwyefKoCGfAPgNvRx0t8R3bdLfVJ0KIPpgvJ7ZuD8 -n4LEHLPoldDmoshdxl/BiQyLhaEM3W3qkwANVic6/8eCqy/N23CM74L4xgUaQDoq -dvkS3PKuhLvcYh4HkZNhALj7Mavvs0x8/pIGx8bK8JCNOhKX7rGylF6erDFfZ8Ym -T2vN0PjVYS/pF//qKHPyV5yVc5piudCB895LBNIDcJK1b67nUUE= -=+e9J ------END PGP SIGNATURE----- +P.S MOVED PGP SIGNATURE TO CHANGELOGHISTORY.TXT @ +https://github.com/nerdunit/androidsideloader \ No newline at end of file diff --git a/version b/version index 96d77177..cae9add9 100644 --- a/version +++ b/version @@ -1 +1 @@ -2.8.1 \ No newline at end of file +2.8.2 \ No newline at end of file