Compare commits
1
Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
963e3511fe |
@@ -18,7 +18,6 @@ from stuff.nodataperm import Nodataperm
|
|||||||
from stuff.smartdock import Smartdock
|
from stuff.smartdock import Smartdock
|
||||||
from stuff.widevine import Widevine
|
from stuff.widevine import Widevine
|
||||||
from stuff.fdroidpriv import FDroidPriv
|
from stuff.fdroidpriv import FDroidPriv
|
||||||
from stuff.tflitefix import TfliteFix
|
|
||||||
import tools.helper as helper
|
import tools.helper as helper
|
||||||
from tools import container
|
from tools import container
|
||||||
from tools import images
|
from tools import images
|
||||||
@@ -145,8 +144,6 @@ def remove_app(args):
|
|||||||
remove_list.append(Nodataperm(args.android_version))
|
remove_list.append(Nodataperm(args.android_version))
|
||||||
if "hidestatusbar" in app:
|
if "hidestatusbar" in app:
|
||||||
remove_list.append(HideStatusBar())
|
remove_list.append(HideStatusBar())
|
||||||
if "tflitefix" in app:
|
|
||||||
remove_list.append(TfliteFix())
|
|
||||||
|
|
||||||
if not container.use_overlayfs():
|
if not container.use_overlayfs():
|
||||||
copy_dir = "/tmp/waydroid"
|
copy_dir = "/tmp/waydroid"
|
||||||
@@ -172,8 +169,6 @@ def hack_option(args):
|
|||||||
hack_list.append(Nodataperm())
|
hack_list.append(Nodataperm())
|
||||||
if "hidestatusbar" in options:
|
if "hidestatusbar" in options:
|
||||||
hack_list.append(HideStatusBar())
|
hack_list.append(HideStatusBar())
|
||||||
if "tflitefix" in options:
|
|
||||||
hack_list.append(TfliteFix())
|
|
||||||
|
|
||||||
if not container.use_overlayfs():
|
if not container.use_overlayfs():
|
||||||
copy_dir = "/tmp/waydroid"
|
copy_dir = "/tmp/waydroid"
|
||||||
@@ -209,7 +204,7 @@ def interact():
|
|||||||
args = argparse.Namespace()
|
args = argparse.Namespace()
|
||||||
android_version = inquirer.select(
|
android_version = inquirer.select(
|
||||||
message="Select Android version",
|
message="Select Android version",
|
||||||
instruction="(↑↓ Select Item)",
|
instruction="(\u2191\u2193 Select Item)",
|
||||||
choices=[
|
choices=[
|
||||||
Choice(name="Android 11", value="11"),
|
Choice(name="Android 11", value="11"),
|
||||||
Choice(name="Android 13", value="13"),
|
Choice(name="Android 13", value="13"),
|
||||||
@@ -235,7 +230,7 @@ def interact():
|
|||||||
exit()
|
exit()
|
||||||
|
|
||||||
install_choices = ["gapps", "microg", "libndk", "libhoudini", "magisk", "smartdock", "fdroidpriv", "widevine",]
|
install_choices = ["gapps", "microg", "libndk", "libhoudini", "magisk", "smartdock", "fdroidpriv", "widevine",]
|
||||||
hack_choices = ["tflitefix"]
|
hack_choices = []
|
||||||
if android_version=="11":
|
if android_version=="11":
|
||||||
hack_choices.extend(["nodataperm", "hidestatusbar"])
|
hack_choices.extend(["nodataperm", "hidestatusbar"])
|
||||||
|
|
||||||
@@ -302,7 +297,7 @@ def main():
|
|||||||
|
|
||||||
install_choices = ["gapps", "microg", "libndk", "libhoudini",
|
install_choices = ["gapps", "microg", "libndk", "libhoudini",
|
||||||
"magisk", "mitm", "smartdock", "widevine"]
|
"magisk", "mitm", "smartdock", "widevine"]
|
||||||
hack_choices = ["nodataperm", "hidestatusbar", "tflitefix"]
|
hack_choices = ["nodataperm", "hidestatusbar"]
|
||||||
micrg_variants = ["Standard", "NoGoolag", "UNLP", "Minimal", "MinimalIAP"]
|
micrg_variants = ["Standard", "NoGoolag", "UNLP", "Minimal", "MinimalIAP"]
|
||||||
remove_choices = install_choices
|
remove_choices = install_choices
|
||||||
|
|
||||||
|
|||||||
+2
-2
@@ -36,11 +36,11 @@ class MicroG(General):
|
|||||||
"6136b383153c2a6797d14fb4d7ca3f97"
|
"6136b383153c2a6797d14fb4d7ca3f97"
|
||||||
],
|
],
|
||||||
"Minimal": [
|
"Minimal": [
|
||||||
"https://github.com/ayasa520/MinMicroG/releases/download/latest/MinMicroG-Minimal-2.11.1-20230429100521.zip"
|
"https://github.com/ayasa520/MinMicroG/releases/download/latest/MinMicroG-Minimal-2.11.1-20230429100521.zip",
|
||||||
"afb87eb64e7749cfd72c4760d85849da"
|
"afb87eb64e7749cfd72c4760d85849da"
|
||||||
],
|
],
|
||||||
"MinimalIAP": [
|
"MinimalIAP": [
|
||||||
"https://github.com/ayasa520/MinMicroG/releases/download/latest/MinMicroG-MinimalIAP-2.11.1-20230429100556.zip"
|
"https://github.com/ayasa520/MinMicroG/releases/download/latest/MinMicroG-MinimalIAP-2.11.1-20230429100556.zip",
|
||||||
"cc071f4f776cbc16c4c1f707aff1f7fa"
|
"cc071f4f776cbc16c4c1f707aff1f7fa"
|
||||||
]
|
]
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,78 +0,0 @@
|
|||||||
import glob
|
|
||||||
import os
|
|
||||||
import shutil
|
|
||||||
from stuff.general import General
|
|
||||||
from tools.logger import Logger
|
|
||||||
|
|
||||||
|
|
||||||
class TfliteFix(General):
|
|
||||||
id = "tflitefix"
|
|
||||||
partition = "system"
|
|
||||||
TARGET_OFFSET = 0x2E9204
|
|
||||||
PATCH_BYTES = b"\xc0\x03\x5f\xd6" # ret in AArch64 little-endian
|
|
||||||
|
|
||||||
def __init__(self, android_version="13") -> None:
|
|
||||||
super().__init__()
|
|
||||||
|
|
||||||
def download(self):
|
|
||||||
pass
|
|
||||||
|
|
||||||
@property
|
|
||||||
def skip_extract(self):
|
|
||||||
return True
|
|
||||||
|
|
||||||
def copy(self):
|
|
||||||
pass
|
|
||||||
|
|
||||||
def extra1(self):
|
|
||||||
"""Applies binary patch to libtensorflowlite.so in installed apps"""
|
|
||||||
search_paths = [
|
|
||||||
os.path.expanduser("~/.local/share/waydroid/data/app/~~*==/*/lib/arm64/libtensorflowlite.so"),
|
|
||||||
"/var/lib/waydroid/data/app/~~*==/*/lib/arm64/libtensorflowlite.so",
|
|
||||||
]
|
|
||||||
found = []
|
|
||||||
for p in search_paths:
|
|
||||||
found.extend(glob.glob(p))
|
|
||||||
|
|
||||||
if not found:
|
|
||||||
Logger.warning("No installed apps with libtensorflowlite.so found in Waydroid data.")
|
|
||||||
return
|
|
||||||
|
|
||||||
for lib_path in found:
|
|
||||||
try:
|
|
||||||
with open(lib_path, "rb") as f:
|
|
||||||
data = bytearray(f.read())
|
|
||||||
|
|
||||||
if len(data) > self.TARGET_OFFSET + 4:
|
|
||||||
if bytes(data[self.TARGET_OFFSET:self.TARGET_OFFSET+4]) == self.PATCH_BYTES:
|
|
||||||
Logger.info(f"Patch already applied to {lib_path}")
|
|
||||||
continue
|
|
||||||
|
|
||||||
backup = lib_path + ".orig"
|
|
||||||
if not os.path.exists(backup):
|
|
||||||
shutil.copy2(lib_path, backup)
|
|
||||||
|
|
||||||
data[self.TARGET_OFFSET:self.TARGET_OFFSET+4] = self.PATCH_BYTES
|
|
||||||
with open(lib_path, "wb") as f:
|
|
||||||
f.write(data)
|
|
||||||
os.chmod(lib_path, 0o755)
|
|
||||||
Logger.info(f"Successfully patched {lib_path}")
|
|
||||||
except Exception as e:
|
|
||||||
Logger.error(f"Failed to patch {lib_path}: {e}")
|
|
||||||
|
|
||||||
def extra2(self):
|
|
||||||
"""Restores original libtensorflowlite.so from backup"""
|
|
||||||
search_paths = [
|
|
||||||
os.path.expanduser("~/.local/share/waydroid/data/app/~~*==/*/lib/arm64/libtensorflowlite.so.orig"),
|
|
||||||
"/var/lib/waydroid/data/app/~~*==/*/lib/arm64/libtensorflowlite.so.orig",
|
|
||||||
]
|
|
||||||
for p in search_paths:
|
|
||||||
for orig in glob.glob(p):
|
|
||||||
target = orig[:-5]
|
|
||||||
try:
|
|
||||||
shutil.copy2(orig, target)
|
|
||||||
os.remove(orig)
|
|
||||||
os.chmod(target, 0o755)
|
|
||||||
Logger.info(f"Restored {target}")
|
|
||||||
except Exception as e:
|
|
||||||
Logger.error(f"Failed to restore {target}: {e}")
|
|
||||||
Reference in New Issue
Block a user