#!/system/bin/sh

MODDIR=${0%/*}
# shellcheck disable=SC1090
. "$MODDIR/common.sh"

log_note "service.sh invoked"
wait_for_boot_completed

# LSPosed-Irena 风格：模块侧先启动 root helper，再保证 Manager APK 存在。
sh "$MODDIR/manager-helper.sh" start >/dev/null 2>&1 || log_note "manager helper start failed"

install_manager_apk >/dev/null 2>&1 || log_note "Manager apk install skipped or failed"

exec sh "$MODDIR/server.sh" start
