2018-01-23 20:11:52 +00:00
|
|
|
#!/system/bin/sh
|
|
|
|
# Please don't hardcode /magisk/modname/... ; instead, please use $MODDIR/...
|
|
|
|
# This will make your scripts compatible even if Magisk change its mount point in the future
|
|
|
|
MODDIR=${0%/*}
|
|
|
|
|
|
|
|
# Create private Log directory
|
|
|
|
LOGDIR="${MODDIR}"/.logs
|
|
|
|
|
2018-02-08 19:52:57 +00:00
|
|
|
[[ ! -d ${LOGDIR} ]] && mkdir -p "${LOGDIR}"
|
2018-01-23 20:11:52 +00:00
|
|
|
|
|
|
|
# Set current date in 20170607-12.07.25 format
|
|
|
|
CURDATE=$(date +%Y%m%d-%I.%M.%S)
|
|
|
|
|
2019-01-03 09:41:23 +00:00
|
|
|
# wait until boot completed
|
|
|
|
until [ `getprop sys.boot_completed`. = 1. ]; do sleep 1; done
|
|
|
|
|
2018-01-23 20:11:52 +00:00
|
|
|
# This script will be executed in late_start service mode
|
|
|
|
# More info in the main Magisk thread
|
2019-01-05 16:36:38 +00:00
|
|
|
for init in fstrim logscleaner sqlite external_sd; do
|
2018-01-23 20:11:52 +00:00
|
|
|
"${MODDIR}/init.d/${init}" | \
|
|
|
|
tee -a "${LOGDIR}/${init}.log.${CURDATE}" &
|
|
|
|
done
|
2018-02-08 19:52:57 +00:00
|
|
|
|
2018-03-02 19:38:06 +00:00
|
|
|
# in Magisk Mode microG DroidGuard Helper needs to be installed as user app
|
2019-01-03 09:41:23 +00:00
|
|
|
pm list packages -f | grep -q /data.*org.microg.gms.droidguard || \
|
2019-01-04 21:52:39 +00:00
|
|
|
pm install -r "${MODDIR}/system/app/DroidGuard/DroidGuard.apk" &
|
2018-03-02 19:38:06 +00:00
|
|
|
|
2018-11-09 20:12:55 +00:00
|
|
|
# install Magisk Manager if NanoDroid migration was run
|
2019-01-03 09:41:23 +00:00
|
|
|
[ -f /data/adb/magisk.apk ] && \
|
2018-11-09 20:12:55 +00:00
|
|
|
pm install -r /data/adb/magisk.apk ; \
|
|
|
|
rm -f /data/adb/magisk.apk &
|
|
|
|
|
2018-02-09 16:09:41 +00:00
|
|
|
"${MODDIR}/init.d/logcat" &
|