Skip to content

Commit ea12ace

Browse files
author
Julien Jorge
committed
Add an option to grant all permissions when installing an APK.
1 parent fceb877 commit ea12ace

File tree

1 file changed

+10
-4
lines changed

1 file changed

+10
-4
lines changed

src/com/dtmilano/android/viewclient.py

Lines changed: 10 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -4356,11 +4356,17 @@ def pilNotInstalledWarning(self):
43564356
$ brew install homebrew/python/pillow
43574357
''')
43584358

4359-
def installPackage(self, apk, allowTestApk=False):
4359+
def installPackage(self, apk, allowTestApk=False, grantAllPermissions=False):
4360+
command = [self.adb, "-s", self.serialno, "install", "-r"]
4361+
43604362
if allowTestApk:
4361-
return subprocess.check_call([self.adb, "-s", self.serialno, "install", "-r", "-t", apk], shell=False)
4362-
else:
4363-
return subprocess.check_call([self.adb, "-s", self.serialno, "install", "-r", apk], shell=False)
4363+
command.append("-t")
4364+
4365+
if grantAllPermissions:
4366+
command.append("-g")
4367+
4368+
command.append(apk)
4369+
subprocess.check_call(command, shell=False)
43644370

43654371
@staticmethod
43664372
def writeViewImageToFileInDir(view):

0 commit comments

Comments
 (0)