fixed stuff

This commit is contained in:
Rookie
2021-04-15 20:39:22 +08:00
parent c5f7ef003a
commit 89e6b84183
6 changed files with 29 additions and 24 deletions

8
ADB.cs
View File

@@ -111,7 +111,11 @@ namespace AndroidSideloader
public static ProcessOutput Sideload(string path)
{
WakeDevice();
return RunAdbCommandToString($"install -g -r \"{path}\"");
ProcessOutput ret = new ProcessOutput();
AndroidSideloader.Program.form.ChangeTitle($"Sideloading {path}");
ret = RunAdbCommandToString($"install -g -r \"{path}\"");
AndroidSideloader.Program.form.ChangeTitle($"Sideload done");
return ret;
}
public static ProcessOutput CopyOBB(string path)
@@ -119,7 +123,7 @@ namespace AndroidSideloader
WakeDevice();
if (SideloaderUtilities.CheckFolderIsObb(path))
return RunAdbCommandToString($"push \"{path}\" /sdcard/Android/obb");
return new ProcessOutput("","");
return new ProcessOutput();
}
}
}

28
MainForm.Designer.cs generated
View File

@@ -41,7 +41,6 @@
this.copyBulkObbButton = new System.Windows.Forms.Button();
this.downloadInstallGameButton = new System.Windows.Forms.Button();
this.panel1 = new System.Windows.Forms.Panel();
this.freeDisclaimer = new System.Windows.Forms.Label();
this.downloadingLabel = new System.Windows.Forms.Label();
this.StorageLabel = new System.Windows.Forms.Label();
this.aboutBtn = new System.Windows.Forms.Button();
@@ -63,6 +62,7 @@
this.diskLabel = new System.Windows.Forms.Label();
this.speedLabel = new System.Windows.Forms.Label();
this.etaLabel = new System.Windows.Forms.Label();
this.freeDisclaimer = new System.Windows.Forms.Label();
this.pictureBox1 = new System.Windows.Forms.PictureBox();
this.gamesQueListBox = new System.Windows.Forms.ListBox();
this.devicesComboBox = new System.Windows.Forms.ComboBox();
@@ -339,18 +339,6 @@
this.panel1.Size = new System.Drawing.Size(218, 887);
this.panel1.TabIndex = 73;
//
// freeDisclaimer
//
this.freeDisclaimer.AutoSize = true;
this.freeDisclaimer.DataBindings.Add(new System.Windows.Forms.Binding("ForeColor", global::AndroidSideloader.Properties.Settings.Default, "FontColor", true, System.Windows.Forms.DataSourceUpdateMode.OnPropertyChanged));
this.freeDisclaimer.Font = new System.Drawing.Font("Microsoft Sans Serif", 13.8F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
this.freeDisclaimer.ForeColor = global::AndroidSideloader.Properties.Settings.Default.FontColor;
this.freeDisclaimer.Location = new System.Drawing.Point(223, 854);
this.freeDisclaimer.Name = "freeDisclaimer";
this.freeDisclaimer.Size = new System.Drawing.Size(487, 24);
this.freeDisclaimer.TabIndex = 79;
this.freeDisclaimer.Text = "This app is FREE github.com/nerdunit/androidsideloader";
//
// downloadingLabel
//
this.downloadingLabel.AutoSize = true;
@@ -740,6 +728,18 @@
this.etaLabel.TabIndex = 75;
this.etaLabel.Text = "ETA: HH:MM:SS Left";
//
// freeDisclaimer
//
this.freeDisclaimer.AutoSize = true;
this.freeDisclaimer.DataBindings.Add(new System.Windows.Forms.Binding("ForeColor", global::AndroidSideloader.Properties.Settings.Default, "FontColor", true, System.Windows.Forms.DataSourceUpdateMode.OnPropertyChanged));
this.freeDisclaimer.Font = new System.Drawing.Font("Microsoft Sans Serif", 13.8F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
this.freeDisclaimer.ForeColor = global::AndroidSideloader.Properties.Settings.Default.FontColor;
this.freeDisclaimer.Location = new System.Drawing.Point(223, 854);
this.freeDisclaimer.Name = "freeDisclaimer";
this.freeDisclaimer.Size = new System.Drawing.Size(487, 24);
this.freeDisclaimer.TabIndex = 79;
this.freeDisclaimer.Text = "This app is FREE github.com/nerdunit/androidsideloader";
//
// pictureBox1
//
this.pictureBox1.BackColor = System.Drawing.Color.Transparent;
@@ -837,7 +837,7 @@
this.searchTextBox.Name = "searchTextBox";
this.searchTextBox.Size = new System.Drawing.Size(232, 24);
this.searchTextBox.TabIndex = 83;
this.searchTextBox.Text = "Search mirror...";
this.searchTextBox.Text = "Search";
this.searchTextBox.TextChanged += new System.EventHandler(this.searchTextBox_TextChanged);
//
// gamesPictureBox

View File

@@ -720,10 +720,8 @@ Do you want to delete the {Sideloader.CrashLogPath} (if you press yes, this mess
if (itemsCount > 0)
{
var rand = new Random();
if (random == true)
if (random == true && index < itemsCount)
index = rand.Next(0, itemsCount);
else if (index > itemsCount)
index = 0;
remotesList.Invoke(() =>
{
remotesList.SelectedIndex = index;
@@ -1010,6 +1008,7 @@ without him none of this would be possible
ADB.DeviceID = GetDeviceID();
quotaTries = 0;
progressBar.Value = 0;
progressBar.Style = ProgressBarStyle.Marquee;
ChangeTitle("Installing game apk " + gameName, false);
etaLabel.Text = "ETA: Wait for install...";
speedLabel.Text = "DLS: Done downloading";
@@ -1033,7 +1032,7 @@ without him none of this would be possible
ChangeTitle($"Resigning {file}");
//spoofer.PackageName(file);
output += spoofer.SpoofApk(file, spoofer.PackageName(file), "", Path.GetFileNameWithoutExtension(file) + "r.apk");
ChangeTitle($"Done resigning {file}");
output += ADB.Sideload(spoofer.spoofedApkPath);
}
else
@@ -1084,8 +1083,10 @@ without him none of this would be possible
showAvailableSpace();
}
}
progressBar.Style = ProgressBarStyle.Continuous;
etaLabel.Text = "ETA: Finished Queue";
speedLabel.Text = "DLS: Finished Queue";
ProgressText.Text = "";
await CheckForDevice();
ChangeTitlebarToDevice();
gamesAreDownloading = false;

View File

@@ -32,7 +32,7 @@ namespace AndroidSideloader
{
Environment.SetEnvironmentVariable("RCLONE_CRYPT_REMOTE", rclonepw);
Environment.SetEnvironmentVariable("RCLONE_CONFIG_PASS", rclonepw);
ProcessOutput prcoutput = new ProcessOutput("","");
ProcessOutput prcoutput = new ProcessOutput();
rclone.StartInfo.StandardOutputEncoding = Encoding.UTF8;
string originalCommand = command;
if (bandwithLimit.Length > 0)

View File

@@ -43,7 +43,7 @@ And all of them added to PATH, without ANY of them, the spoofer won't work!";
public static ProcessOutput RunADBCommandsFromFile(string path, string RunFromPath)
{
ADB.WakeDevice();
ProcessOutput output = new ProcessOutput("","");
ProcessOutput output = new ProcessOutput();
var commands = File.ReadAllLines(path);
foreach (string cmd in commands)
{
@@ -62,7 +62,7 @@ And all of them added to PATH, without ANY of them, the spoofer won't work!";
return output;
}
public static ProcessOutput RecursiveOutput = new ProcessOutput("","");
public static ProcessOutput RecursiveOutput = new ProcessOutput();
public static void RecursiveSideload(string FolderPath)
{
try

View File

@@ -11,7 +11,7 @@ namespace AndroidSideloader
public string Output;
public string Error;
public ProcessOutput(string output, string error)
public ProcessOutput(string output = "", string error = "")
{
Output = output;
Error = error;