Fix resize error log
This commit is contained in:
parent
9d9f504625
commit
4d15b6153c
4 changed files with 13 additions and 22 deletions
|
|
@ -84,7 +84,8 @@ class MicroG(General):
|
|||
print("\r\tPlease start WayDroid for further setup {}".format(list[index%4]), end="")
|
||||
index += 1
|
||||
sleep(5)
|
||||
print()
|
||||
if index != 0:
|
||||
print()
|
||||
Logger.info("Signature spoofing")
|
||||
run("waydroid shell pm grant com.google.android.gms android.permission.FAKE_PACKAGE_SIGNATURE".split())
|
||||
run("waydroid shell pm grant com.android.vending android.permission.FAKE_PACKAGE_SIGNATURE".split())
|
||||
|
|
|
|||
|
|
@ -31,5 +31,6 @@ class Smartdock(General):
|
|||
print("\r\tPlease start WayDroid for further setup {}".format(list[index%4]), end="")
|
||||
index += 1
|
||||
sleep(5)
|
||||
print()
|
||||
if index != 0:
|
||||
print()
|
||||
run(["waydroid", "shell", "cmd", "package", "set-home-activity", "cu.axel.smartdock/.activities.LauncherActivity"])
|
||||
|
|
|
|||
|
|
@ -1,4 +1,5 @@
|
|||
import os
|
||||
import re
|
||||
import platform
|
||||
import re
|
||||
import subprocess
|
||||
|
|
@ -18,24 +19,18 @@ def get_download_dir():
|
|||
os.makedirs(download_loc)
|
||||
return download_loc
|
||||
|
||||
def run(args: list, env = None, ignore = None):
|
||||
result = subprocess.run(
|
||||
args=args,
|
||||
env=env,
|
||||
stdout=subprocess.PIPE,
|
||||
stderr=subprocess.PIPE
|
||||
)
|
||||
|
||||
def run(args, ignore=""):
|
||||
result = subprocess.run(args=args, stdout=subprocess.PIPE, stderr=subprocess.PIPE)
|
||||
# print(result.stdout.decode())
|
||||
if result.stderr:
|
||||
error = result.stderr.decode("utf-8")
|
||||
if ignore and re.match(ignore, error):
|
||||
if re.match(ignore, error):
|
||||
return result
|
||||
Logger.error(error)
|
||||
raise subprocess.CalledProcessError(
|
||||
returncode=result.returncode,
|
||||
cmd=result.args,
|
||||
stderr=result.stderr
|
||||
returncode = result.returncode,
|
||||
cmd = result.args,
|
||||
stderr = result.stderr
|
||||
)
|
||||
return result
|
||||
|
||||
|
|
|
|||
|
|
@ -24,14 +24,8 @@ def umount(mount_point, exists=True):
|
|||
mount_point))
|
||||
|
||||
def resize(img_file, size):
|
||||
try:
|
||||
run(["e2fsck", "-y", "-f", img_file])
|
||||
except subprocess.CalledProcessError:
|
||||
pass
|
||||
try:
|
||||
run(["resize2fs", img_file, size])
|
||||
except subprocess.CalledProcessError:
|
||||
pass
|
||||
run(["sudo", "e2fsck", "-y", "-f", img_file], "^e2fsck \d+\.\d+\.\d (.+)\n$")
|
||||
run(["sudo", "resize2fs", img_file, size], "^resize2fs \d+\.\d+\.\d (.+)\n$")
|
||||
|
||||
def get_image_dir():
|
||||
# Read waydroid config to get image location
|
||||
|
|
|
|||
Loading…
Reference in a new issue