Skip to content

Commit

Permalink
Autoupload WITHOUT new game detection (for live release)
Browse files Browse the repository at this point in the history
  • Loading branch information
harryeffinpotter committed Aug 19, 2021
1 parent 26442e9 commit 3e67b33
Show file tree
Hide file tree
Showing 7 changed files with 107 additions and 58 deletions.
43 changes: 43 additions & 0 deletions ChangelogHistory.txt
Original file line number Diff line number Diff line change
@@ -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.
Expand Down
70 changes: 34 additions & 36 deletions MainForm.cs
Original file line number Diff line number Diff line change
Expand Up @@ -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");
Expand All @@ -1298,7 +1312,7 @@ private async void initListView()
}
}
gamesToUpload.Clear();

isworking = false;
isuploading = false;
ULGif.Visible = false;
ULLabel.Visible = false;
Expand Down Expand Up @@ -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;
Expand Down
2 changes: 2 additions & 0 deletions Sideloader/RCLONE.cs
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down
2 changes: 1 addition & 1 deletion Updater.cs
Original file line number Diff line number Diff line change
Expand Up @@ -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;

Expand Down
6 changes: 6 additions & 0 deletions Utilities/UploadGame.cs
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
40 changes: 20 additions & 20 deletions changelog.txt
Original file line number Diff line number Diff line change
@@ -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
2 changes: 1 addition & 1 deletion version
Original file line number Diff line number Diff line change
@@ -1 +1 @@
2.8.1
2.8.2

0 comments on commit 3e67b33

Please sign in to comment.