prop: run 'waydroid upgrade -o' to regenerate base prop

pull/80/head
Rikka 2 years ago
parent 1caafe57e6
commit abdc3b015d
No known key found for this signature in database
GPG Key ID: CD36B07FA9F7D2AA

@ -4,7 +4,7 @@ import re
import zipfile
import hashlib
from tools import images
from tools.helper import download_file, get_download_dir, run
from tools.helper import download_file, get_download_dir, run, upgrade
from tools.container import DBusContainerService
from tools.logger import Logger
@ -103,10 +103,12 @@ class General:
DBusContainerService().Start(self.session)
else:
run(["systemctl", "restart", "waydroid-container.service"])
upgrade()
def restart(self):
self.stop()
self.start()
upgrade()
def copy(self):
pass

@ -1,5 +1,6 @@
import os
import platform
import re
import subprocess
import sys
import requests
@ -17,11 +18,20 @@ def get_download_dir():
os.makedirs(download_loc)
return download_loc
def run(args):
result = subprocess.run(args=args, stdout=subprocess.PIPE, stderr=subprocess.PIPE)
def run(args: list, env = None, ignore = None):
result = subprocess.run(
args=args,
env=env,
stdout=subprocess.PIPE,
stderr=subprocess.PIPE
)
# print(result.stdout.decode())
if result.stderr:
Logger.error(result.stderr.decode("utf-8"))
error = result.stderr.decode("utf-8")
if ignore and re.match(ignore, error):
return result
Logger.error(error)
raise subprocess.CalledProcessError(
returncode=result.returncode,
cmd=result.args,
@ -72,3 +82,6 @@ def check_root():
if os.geteuid() != 0:
Logger.error("This script must be run as root. Aborting.")
sys.exit(1)
def upgrade():
run(["waydroid", "upgrade", "-o"], ignore=r"\[.*\] Stopping container\n\[.*\] Starting container")
Loading…
Cancel
Save