helpers.images.umount_rootfs(args)
if args.images_path not in tools.config.defaults["preinstalled_images_paths"]:
helpers.images.get(args)
+ else:
+ helpers.images.remove_overlay(args)
if not os.path.isdir(tools.config.defaults["rootfs"]):
os.mkdir(tools.config.defaults["rootfs"])
if not os.path.isdir(tools.config.defaults["overlay"]):
import zipfile
import json
import hashlib
+import shutil
import os
import tools.config
from tools import helpers
tools.config.save(args, cfg)
os.remove(images_zip)
break
+ remove_overlay(args)
def replace(args, system_zip, system_time, vendor_zip, vendor_time):
cfg = tools.config.load(args)
zip_ref.extractall(args.images_path)
cfg["waydroid"]["vendor_datetime"] = str(vendor_time)
tools.config.save(args, cfg)
+ remove_overlay(args)
+
+def remove_overlay(args):
+ if os.path.isdir(tools.config.defaults["overlay_rw"]):
+ shutil.rmtree(tools.config.defaults["overlay_rw"])
+ if os.path.isdir(tools.config.defaults["overlay_work"]):
+ shutil.rmtree(tools.config.defaults["overlay_work"])
def make_prop(args, cfg, full_props_path):
if not os.path.isfile(args.work + "/waydroid_base.prop"):