initial commit
This commit is contained in:
@@ -0,0 +1,33 @@
|
||||
#!/sbin/sh
|
||||
|
||||
#################
|
||||
# Initialization
|
||||
#################
|
||||
|
||||
umask 022
|
||||
|
||||
# echo before loading util_functions
|
||||
ui_print() { echo "$1"; }
|
||||
|
||||
require_new_magisk() {
|
||||
ui_print "*******************************"
|
||||
ui_print " Please install Magisk v20.4+! "
|
||||
ui_print "*******************************"
|
||||
exit 1
|
||||
}
|
||||
|
||||
#########################
|
||||
# Load util_functions.sh
|
||||
#########################
|
||||
|
||||
OUTFD=$2
|
||||
ZIPFILE=$3
|
||||
|
||||
mount /data 2>/dev/null
|
||||
|
||||
[ -f /data/adb/magisk/util_functions.sh ] || require_new_magisk
|
||||
. /data/adb/magisk/util_functions.sh
|
||||
[ $MAGISK_VER_CODE -lt 20400 ] && require_new_magisk
|
||||
|
||||
install_module
|
||||
exit 0
|
||||
@@ -0,0 +1,2 @@
|
||||
#MAGISK
|
||||
|
||||
@@ -1,2 +1,20 @@
|
||||
# zerotier-magisk
|
||||
start ZeroTier in the background after startup
|
||||
This magisk module enables you to start zerotier in the background after booting.
|
||||
|
||||
## Installation
|
||||
|
||||
1. download zipped code file from github.
|
||||
2. modify zerotier/network and write down your own network id.
|
||||
3. install and enjoy.
|
||||
|
||||
### Scripts and binaries
|
||||
|
||||
all the scripts and binaries are placed in `/data/adb/zerotier/` , you can use termux to run them if needed.
|
||||
|
||||
`add_ip_rule.sh` is used to make the `main` route table, which zerotier writes its routes to, available.
|
||||
|
||||
### Build binaries yourself
|
||||
|
||||
Note that the zerotier binaries are only build for aarch64, you can build it yourself in termux.
|
||||
|
||||
Remember to delete `ZT_SSO_SUPPORTED=1` if you don't want to build zeroidc with rust.
|
||||
|
||||
@@ -0,0 +1,34 @@
|
||||
#!/system/bin/sh
|
||||
|
||||
SKIPUNZIP=1
|
||||
ASH_STANDALONE=0
|
||||
|
||||
ZT_PATH=/data/adb/zerotier
|
||||
|
||||
ui_print "- unzip"
|
||||
unzip -o "${ZIPFILE}" -x 'META-INF/*' -d "${MODPATH}" >&2
|
||||
|
||||
ui_print "- set file permission"
|
||||
set_perm_recursive ${MODPATH}/zerotier 0 0 0755 0755
|
||||
|
||||
ui_print "- create work dir"
|
||||
mkdir -p ${ZT_PATH}
|
||||
mv ${MODPATH}/zerotier/* ${ZT_PATH}
|
||||
|
||||
ln -s ${ZT_PATH}/zerotier-one ${ZT_PATH}/zerotier-cli
|
||||
ln -s ${ZT_PATH}/zerotier-one ${ZT_PATH}/zerotier-idtool
|
||||
|
||||
ui_print "- clean up"
|
||||
rm -rf ${MODPATH}/customize.sh 2>/dev/null
|
||||
rm -rf ${MODPATH}/bin 2>/dev/null
|
||||
sleep 1
|
||||
|
||||
ui_print "- installed"
|
||||
|
||||
set_perm_recursive ${MODPATH} 0 0 0755 0644
|
||||
|
||||
ui_print "---------- information -----------"
|
||||
ui_print "- zerotier root: ${ZT_PATH}"
|
||||
ui_print "- zerotier version: $(grep_prop version ${TMPDIR}/module.prop)"
|
||||
|
||||
|
||||
@@ -0,0 +1,6 @@
|
||||
id=zerotier
|
||||
name=Zerotier For Magisk
|
||||
version=v1.0.0
|
||||
versionCode=100
|
||||
author=eventlOwOp
|
||||
description=zerotier binary build for aarch64
|
||||
@@ -0,0 +1,9 @@
|
||||
#!/system/bin/sh
|
||||
|
||||
MODDIR=${0%/*}
|
||||
|
||||
cd /data/adb/zerotier
|
||||
|
||||
sh ./add_ip_rule.sh
|
||||
sh ./start.sh
|
||||
sh ./join.sh
|
||||
@@ -0,0 +1 @@
|
||||
rm -rf /data/adb/zerotier
|
||||
@@ -0,0 +1 @@
|
||||
ip rule add from all lookup main pref 1
|
||||
@@ -0,0 +1 @@
|
||||
cat ./network | xargs ./zerotier-cli -D./home join
|
||||
@@ -0,0 +1 @@
|
||||
cat ./network | xargs ./zerotier-cli -D./home leave
|
||||
@@ -0,0 +1 @@
|
||||
1111111111111111
|
||||
@@ -0,0 +1 @@
|
||||
./zerotier-one -d home &
|
||||
Binary file not shown.
Reference in New Issue
Block a user