Fix resize error log
This commit is contained in:
@@ -84,6 +84,7 @@ class MicroG(General):
|
||||
print("\r\tPlease start WayDroid for further setup {}".format(list[index%4]), end="")
|
||||
index += 1
|
||||
sleep(5)
|
||||
if index != 0:
|
||||
print()
|
||||
Logger.info("Signature spoofing")
|
||||
run("waydroid shell pm grant com.google.android.gms 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)
|
||||
if index != 0:
|
||||
print()
|
||||
run(["waydroid", "shell", "cmd", "package", "set-home-activity", "cu.axel.smartdock/.activities.LauncherActivity"])
|
||||
|
||||
+4
-9
@@ -1,4 +1,5 @@
|
||||
import os
|
||||
import re
|
||||
import platform
|
||||
import re
|
||||
import subprocess
|
||||
@@ -18,18 +19,12 @@ 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(
|
||||
|
||||
+2
-8
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user