Uninstall function, microG installation and some hacks #70

Merged
ayasa520 merged 42 commits from main into main 2023-05-28 02:54:02 -04:00
4 changed files with 13 additions and 22 deletions
Showing only changes of commit 4d15b6153c - Show all commits
+1
View File
@@ -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())
+1
View File
@@ -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
View File
@@ -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
View File
@@ -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