Skip to content

Commit

Permalink
Fixed bug that prevented folders from loading when folder name contai…
Browse files Browse the repository at this point in the history
…ned space
  • Loading branch information
T0biasCZe committed Aug 4, 2024
1 parent f651e26 commit 2043421
Show file tree
Hide file tree
Showing 7 changed files with 18 additions and 89 deletions.
2 changes: 1 addition & 1 deletion AdbFileManager/CurrentCommit.txt
Original file line number Diff line number Diff line change
@@ -1 +1 @@
9cfa2c2
f651e26
2 changes: 1 addition & 1 deletion AdbFileManager/Form1.cs
Original file line number Diff line number Diff line change
Expand Up @@ -688,7 +688,7 @@ public static DataTable getDir(string directoryPath, bool old_android, bool old_

// Retrieve a list of files in the specified directory

string command = $"adb shell ls -lL \"{directoryPath}\"";
string command = $"adb shell ls -lL \"'{directoryPath}'\"";
Console.WriteLine(command);
string output = Form1.adb(command);
string[] lines = output.Split(new[] { Environment.NewLine }, StringSplitOptions.None);
Expand Down
62 changes: 1 addition & 61 deletions AdbFileManager/Properties/Resources.Designer.cs

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

18 changes: 0 additions & 18 deletions AdbFileManager/Properties/Resources.resx
Original file line number Diff line number Diff line change
Expand Up @@ -121,9 +121,6 @@
<data name="travel_pressed_back" type="System.Resources.ResXFileRef, System.Windows.Forms">
<value>..\Resources\travel_pressed_back.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a</value>
</data>
<data name="unlock1" type="System.Resources.ResXFileRef, System.Windows.Forms">
<value>..\Resources\unlock.ico;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a</value>
</data>
<data name="lockedShadow" type="System.Resources.ResXFileRef, System.Windows.Forms">
<value>..\Resources\lockedShadow.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a</value>
</data>
Expand All @@ -133,24 +130,12 @@
<data name="travel_forward_enabled" type="System.Resources.ResXFileRef, System.Windows.Forms">
<value>..\Resources\travel_forward_enabled.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a</value>
</data>
<data name="unlockk" type="System.Resources.ResXFileRef, System.Windows.Forms">
<value>..\Resources\unlockk.ico;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a</value>
</data>
<data name="unlock" type="System.Resources.ResXFileRef, System.Windows.Forms">
<value>..\Resources\unlock.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a</value>
</data>
<data name="unlockkk" type="System.Resources.ResXFileRef, System.Windows.Forms">
<value>..\Resources\unlockkk.ico;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a</value>
</data>
<data name="travel_hot_forward" type="System.Resources.ResXFileRef, System.Windows.Forms">
<value>..\Resources\travel_hot_forward.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a</value>
</data>
<data name="CurrentCommit" type="System.Resources.ResXFileRef, System.Windows.Forms">
<value>..\CurrentCommit.txt;System.String, mscorlib, Version=0.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089;windows-1250</value>
</data>
<data name="unlock24" type="System.Resources.ResXFileRef, System.Windows.Forms">
<value>..\Resources\unlock24.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a</value>
</data>
<data name="travel_back_enabled" type="System.Resources.ResXFileRef, System.Windows.Forms">
<value>..\Resources\travel_back_enabled.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a</value>
</data>
Expand All @@ -160,9 +145,6 @@
<data name="travel_hot_back" type="System.Resources.ResXFileRef, System.Windows.Forms">
<value>..\Resources\travel_hot_back.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a</value>
</data>
<data name="unlock2" type="System.Resources.ResXFileRef, System.Windows.Forms">
<value>..\Resources\unlock1.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a</value>
</data>
<data name="unlockedShadow" type="System.Resources.ResXFileRef, System.Windows.Forms">
<value>..\Resources\unlockedShadow.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a</value>
</data>
Expand Down
14 changes: 8 additions & 6 deletions AdbFileManager/UnlockForm.Designer.cs

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

5 changes: 5 additions & 0 deletions AdbFileManager/UnlockForm.resx
Original file line number Diff line number Diff line change
Expand Up @@ -117,4 +117,9 @@
<resheader name="writer">
<value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</resheader>
<data name="richTextBox1.Text" xml:space="preserve">
<value>After restart, the phone is locked and adb cant access files. However it may not be possible to unlock when the screen is broken.
This tool can try to unlock the phone, so you can backup your photos.
May not work on all phones</value>
</data>
</root>
4 changes: 2 additions & 2 deletions AdbFileManager/legacyAndroid.cs
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ public static class legacyAndroid {
public static bool fastcompatibility = false;
public static DataTable getDir(string directoryPath) {
// Retrieve a list of files in the specified directory without additional details
string command = $"adb shell ls \"{directoryPath}\"";
string command = $"adb shell ls \"'{directoryPath}'\"";
Console.WriteLine(command);
string output = Form1.adb(command);
string[] lines = output.Split(new[] { Environment.NewLine }, StringSplitOptions.None);
Expand Down Expand Up @@ -129,7 +129,7 @@ public static bool isFolder(string path, bool fastmode) {
bool isFolder = false;
//string wholePath = directoryPath + "/" + name;
Console.Write($"checking if \"{path}\" is a folder: ");
string cdCommand = $"adb shell ls \"{path}\"";
string cdCommand = $"adb shell ls \"'{path}'\"";
string cdOutput = Form1.adb(cdCommand);
if(!cdOutput.Trim().Equals(path.Trim())) {
isFolder = true;
Expand Down

0 comments on commit 2043421

Please sign in to comment.