From f6d02c66116a57004893b4b1ecf0c90dfa5d568b Mon Sep 17 00:00:00 2001 From: Marc Bonnici Date: Fri, 21 Apr 2017 15:21:40 +0100 Subject: [PATCH] Target: Add read permissions to tmp files before pulling Previously trying to pull a file from an android target would fail if the file was owned by root, this commit adds read permissions to the file before attempting to pull. --- devlib/target.py | 1 + 1 file changed, 1 insertion(+) diff --git a/devlib/target.py b/devlib/target.py index be2d021..9d7f282 100644 --- a/devlib/target.py +++ b/devlib/target.py @@ -961,6 +961,7 @@ class AndroidTarget(Target): device_tempfile = self.path.join(self._file_transfer_cache, source.lstrip(self.path.sep)) self.execute("mkdir -p '{}'".format(self.path.dirname(device_tempfile))) self.execute("cp '{}' '{}'".format(source, device_tempfile), as_root=True) + self.execute("chmod 0644 '{}'".format(device_tempfile), as_root=True) self.conn.pull(device_tempfile, dest, timeout=timeout) # Android-specific