99)
1010
1111func (a * App ) ListFiles (path string ) ([]FileEntry , error ) {
12- if err := ValidateRemotePath (path ); err != nil {
13- return nil , fmt .Errorf ("invalid path: %w" , err )
14- }
12+
1513
1614 // List files uses default timeout (60s) which is sufficient
1715 output , err := a .runCommand ("adb" , "shell" , "ls" , "-lA" , path )
@@ -102,12 +100,7 @@ func (a *App) ListFiles(path string) ([]FileEntry, error) {
102100}
103101
104102func (a * App ) PushFile (localPath string , remotePath string ) (string , error ) {
105- if err := ValidateFilePath (localPath ); err != nil {
106- return "" , fmt .Errorf ("invalid local path: %w" , err )
107- }
108- if err := ValidateRemotePath (remotePath ); err != nil {
109- return "" , fmt .Errorf ("invalid remote path: %w" , err )
110- }
103+
111104
112105 a .opMutex .Lock ()
113106 ctx , cancel := context .WithTimeout (context .Background (), 30 * time .Minute )
@@ -134,12 +127,7 @@ func (a *App) PushFile(localPath string, remotePath string) (string, error) {
134127}
135128
136129func (a * App ) PullFile (remotePath string , localPath string ) (string , error ) {
137- if err := ValidateRemotePath (remotePath ); err != nil {
138- return "" , fmt .Errorf ("invalid remote path: %w" , err )
139- }
140- if err := ValidateFilePath (localPath ); err != nil {
141- return "" , fmt .Errorf ("invalid local path: %w" , err )
142- }
130+
143131
144132 a .opMutex .Lock ()
145133 // No timeout for file transfers, only user cancellation
@@ -167,12 +155,7 @@ func (a *App) PullFile(remotePath string, localPath string) (string, error) {
167155}
168156
169157func (a * App ) CreateFolder (fullPath string ) (string , error ) {
170- if err := ValidateRemotePath (fullPath ); err != nil {
171- return "" , fmt .Errorf ("invalid path: %w" , err )
172- }
173-
174- sanitizedPath := SanitizeShellArg (fullPath )
175- command := fmt .Sprintf ("mkdir -p '%s'" , sanitizedPath )
158+ command := fmt .Sprintf ("mkdir -p '%s'" , fullPath )
176159
177160 output , err := a .runShellCommand (command )
178161 if err != nil {
@@ -183,12 +166,7 @@ func (a *App) CreateFolder(fullPath string) (string, error) {
183166}
184167
185168func (a * App ) DeleteFile (fullPath string ) (string , error ) {
186- if err := ValidateRemotePath (fullPath ); err != nil {
187- return "" , fmt .Errorf ("invalid path: %w" , err )
188- }
189-
190- sanitizedPath := SanitizeShellArg (fullPath )
191- command := fmt .Sprintf ("rm -rf '%s'" , sanitizedPath )
169+ command := fmt .Sprintf ("rm -rf '%s'" , fullPath )
192170
193171 output , err := a .runShellCommand (command )
194172 if err != nil {
@@ -199,16 +177,7 @@ func (a *App) DeleteFile(fullPath string) (string, error) {
199177}
200178
201179func (a * App ) RenameFile (oldPath string , newPath string ) (string , error ) {
202- if err := ValidateRemotePath (oldPath ); err != nil {
203- return "" , fmt .Errorf ("invalid old path: %w" , err )
204- }
205- if err := ValidateRemotePath (newPath ); err != nil {
206- return "" , fmt .Errorf ("invalid new path: %w" , err )
207- }
208-
209- sanitizedOld := SanitizeShellArg (oldPath )
210- sanitizedNew := SanitizeShellArg (newPath )
211- command := fmt .Sprintf ("mv '%s' '%s'" , sanitizedOld , sanitizedNew )
180+ command := fmt .Sprintf ("mv '%s' '%s'" , oldPath , newPath )
212181
213182 output , err := a .runShellCommand (command )
214183 if err != nil {
0 commit comments