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