Skip to content
This repository was archived by the owner on Feb 2, 2021. It is now read-only.

Commit bd52df0

Browse files
Fatme HavaluovaFatme Havaluova
Fatme Havaluova
authored and
Fatme Havaluova
committed
Ensure that all directories have permissions
On some devices adb push removes write permission of others group. This is problem when trying to move files to /data/data because run-as is alwyas executed with different user from the user who pushes the files to /data/local/tmp.
1 parent 689f53d commit bd52df0

File tree

1 file changed

+9
-1
lines changed

1 file changed

+9
-1
lines changed

mobile/android/android-device-file-system.ts

+9-1
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,15 @@ export class AndroidDeviceFileSystem implements Mobile.IDeviceFileSystem {
2323

2424
public transferFiles(appIdentifier: string, localToDevicePaths: Mobile.ILocalToDevicePathData[]): IFuture<void> {
2525
return (() => {
26-
_.each(localToDevicePaths, (localToDevicePathData) => this.transferFile(localToDevicePathData.getLocalPath(), localToDevicePathData.getDevicePath()).wait());
26+
_(localToDevicePaths)
27+
.filter(localToDevicePathData => this.$fs.getFsStats(localToDevicePathData.getLocalPath()).wait().isFile())
28+
.each(localToDevicePathData => this.adb.executeCommand(`push "${localToDevicePathData.getLocalPath()}" "${localToDevicePathData.getDevicePath()}"`).wait())
29+
.value();
30+
31+
_(localToDevicePaths)
32+
.filter(localToDevicePathData => this.$fs.getFsStats(localToDevicePathData.getLocalPath()).wait().isDirectory())
33+
.each(localToDevicePathData => this.adb.executeShellCommand(`chmod 0777 "${localToDevicePathData.getDevicePath()}"`).wait())
34+
.value();
2735
}).future<void>()();
2836
}
2937

0 commit comments

Comments
 (0)