fixed obb install.txt. Fixed adb errors. Should be all good meow. Also fixed wireless causing program freeze if IP changed.

This commit is contained in:
Harry Fn Potter
2021-06-19 23:03:18 -04:00
parent f72c6b8d95
commit 0bc0f6668a
6 changed files with 19 additions and 18 deletions

6
ADB.cs
View File

@@ -286,7 +286,7 @@ namespace AndroidSideloader
ret.Output = string.Empty;
MessageBox.Show($"In-place upgrade for {packagename} failed. We will need to upgrade by uninstalling, and keeping savedata isn't guaranteed. Continue?", "UPGRADE FAILED!", MessageBoxButtons.OKCancel);
MessageBox.Show($"In place upgrade for {packagename} failed. We will need to upgrade by uninstalling, and keeping savedata isn't guaranteed. Continue?", "UPGRADE FAILED!", MessageBoxButtons.OKCancel);
string date_str = DateTime.Today.ToString("yyyy.MM.dd");
string CurrBackups = Path.Combine(BackupFolder, date_str);
@@ -295,9 +295,9 @@ namespace AndroidSideloader
MessageBox.Show($"Searching for save files...", "Searching!", MessageBoxButtons.OK);
if (Directory.Exists($"/sdcard/Android/data/{packagename}"))
{
MessageBox.Show($"Trying to backup save to Documents\\Rookie Backups\\{date_str}(year.month.date)\\{packagename}\\data", "Save files found", MessageBoxButtons.OK);
MessageBox.Show($"Trying to backup save to Documents\\Rookie Backups\\{date_str}(YYYY.MM.DD)\\{packagename}", "Save files found", MessageBoxButtons.OK);
Directory.CreateDirectory(CurrBackups);
ADB.RunAdbCommandToString($"pull \"/sdcard/Android/data/{packagename} \" \"{CurrBackups}\"");
ADB.RunAdbCommandToString($"pull \"/sdcard/Android/data/{packagename}\" \"{CurrBackups}\"");
}
else
{

View File

@@ -27,7 +27,7 @@
<value>True</value>
</setting>
<setting name="userJsonOnGameInstall" serializeAs="String">
<value>True</value>
<value>False</value>
</setting>
<setting name="CallUpgrade" serializeAs="String">
<value>True</value>

View File

@@ -421,14 +421,17 @@ Do you want to delete the {Sideloader.CrashLogPath} (if you press yes, this mess
ProcessOutput output = new ProcessOutput("", "");
var dialog = new FolderSelectDialog
{
Title = "Select your obb folder"
Title = "Select full backup or packagename backup folder"
};
if (dialog.Show(Handle))
{
string path = dialog.FileName;
Thread t1 = new Thread(() =>
{
output += ADB.RunAdbCommandToString($"push \"{path}\" /sdcard/Android/");
if (path.Contains("data"))
output += ADB.RunAdbCommandToString($"push \"{path}\" /sdcard/Android/");
else
output += ADB.RunAdbCommandToString($"push \"{path}\" /sdcard/Android/data/");
});
t1.IsBackground = true;
t1.Start();
@@ -526,12 +529,10 @@ Do you want to delete the {Sideloader.CrashLogPath} (if you press yes, this mess
string GameName = m_combo.SelectedItem.ToString();
string packagename = Sideloader.gameNameToPackageName(GameName);
MessageBox.Show($"If savedata is found it will be saved to Documents\\Rookie Backups\\{date_str}(year.month.date)\\{packagename}\\data", "Attempting Backup...", MessageBoxButtons.OK);
MessageBox.Show($"If savedata is found it will be saved to Documents\\Rookie Backups\\{date_str}(YYYY.MM.DD)\\{packagename}", "Attempting Backup...", MessageBoxButtons.OK);
Directory.CreateDirectory(CurrBackups);
String CurrbackupPaths = CurrBackups + "\\" + packagename + "\\data";
Directory.CreateDirectory(CurrbackupPaths);
ADB.RunAdbCommandToString($"pull \"/sdcard/Android/data/{packagename}\" \"{CurrbackupPaths}\"");
ADB.RunAdbCommandToString($"pull \"/sdcard/Android/data/{packagename}\" \"{CurrBackups}\"");
DialogResult dialogResult = MessageBox.Show($"Please check to see if we automatically found savedata in Documents\\Rookie Backups.\nIf there are no new files there is recommended that you do a full backup via Backup Gamedata before continuing.\nNOTE: Some games do not allow backup of savedata.\nContinue with the uninstall?", "Check for backup.", MessageBoxButtons.OKCancel);
if (dialogResult == DialogResult.Cancel)
{
@@ -634,8 +635,10 @@ Do you want to delete the {Sideloader.CrashLogPath} (if you press yes, this mess
if (data.StartsWith("com."))
{
output += ADB.CopyOBB(data);
string extension = Path.GetExtension(data);
if (extension == ".apk")
}
string extension = Path.GetExtension(data);
if (extension == ".apk")
{
output += ADB.Sideload(data);
if (File.Exists($"{Environment.CurrentDirectory}\\Install.txt"))
@@ -1228,7 +1231,6 @@ without him none of this would be possible
}
if (quotaError == false)
{
ADB.WakeDevice();
ADB.DeviceID = GetDeviceID();
quotaTries = 0;
progressBar.Value = 0;
@@ -1268,7 +1270,6 @@ without him none of this would be possible
}
Debug.WriteLine(wrDelimiter);
ADB.WakeDevice();
string[] folders = Directory.GetDirectories(Environment.CurrentDirectory + "\\" + gameName);
foreach (string folder in folders)

View File

@@ -85,7 +85,7 @@ namespace AndroidSideloader.Properties {
[global::System.Configuration.UserScopedSettingAttribute()]
[global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
[global::System.Configuration.DefaultSettingValueAttribute("True")]
[global::System.Configuration.DefaultSettingValueAttribute("False")]
public bool userJsonOnGameInstall {
get {
return ((bool)(this["userJsonOnGameInstall"]));

View File

@@ -18,7 +18,7 @@
<Value Profile="(Default)">True</Value>
</Setting>
<Setting Name="userJsonOnGameInstall" Type="System.Boolean" Scope="User">
<Value Profile="(Default)">True</Value>
<Value Profile="(Default)">False</Value>
</Setting>
<Setting Name="CallUpgrade" Type="System.Boolean" Scope="User">
<Value Profile="(Default)">True</Value>

View File

@@ -6,10 +6,10 @@ namespace AndroidSideloader
{
public static bool CheckFolderIsObb(string path)
{
string[] files = Directory.GetFiles(path);
string[] files = Directory.GetDirectories(path);
foreach (string file in files)
if (file.EndsWith(".obb"))
if (file.StartsWith("com."))
return true;
return false;
}