Skip to content

Commit

Permalink
Initial commit
Browse files Browse the repository at this point in the history
  • Loading branch information
ttc0419 committed Sep 6, 2024
0 parents commit 1f45b2c
Show file tree
Hide file tree
Showing 10 changed files with 148 additions and 0 deletions.
7 changes: 7 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
.DS_Store
ipks/*.ipk

.idea
ipk-build
pkg
src
28 changes: 28 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
# UU OpenWrt插件
UU加速器OpenWrt插件ipk安装包

## 安装
```shell
cd /tmp
pkg_name=uuplugin_latest-1_$(grep '^DISTRIB_ARCH' /etc/openwrt_release | awk -F "'" '{print $2}').ipk
wget "https://github.com/ttc0419/uuplugin/releases/download/latest/$pkg_name" && opkg install $pkg_name || echo "You router is not supported!"
```

## 架构支持
目前网易官方支持aarch64, arm, mpisel和x86_64。前三种架构官方没有说明哪几种子架构支持。
如果你认为插件支持额外子架构或某些子架构其实不支持,请创建新的issue说明。
当前支持列表根据objdump所用的指令为依据。

以下几种情况不提供支持:
1. 最新发布版本无此架构
2. 架构所支持的路由器在中国使用率过少
3. 架构不在OpenWrt官方支持列表中

## 系统支持
加速器现阶段还是使用```iptables```配置防火墙规则,理论上只支持OpenWrt 21及之前的系统版本,22及之后的版本可以尝试安装```iptables-nft```来兼容。

## 捐助
开源不易,如果项目有帮到你,能投喂一下嘛 😉

| [![PayPal](/images/paypal.svg)](https://www.paypal.com/paypalme/tianchentang)<br/>Click [here](https://www.paypal.com/paypalme/tianchentang) to donate | ![Wechat Pay](/images/wechat.jpg)<br/>Wechat Pay | ![Alipay](/images/alipay.jpg) Alipay |
|--------------------------------------------------------------------------------------------------------------------------------------------------------|--------------------------------------------------|--------------------------------------|
39 changes: 39 additions & 0 deletions build-all.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
#!/bin/sh
set -e

[ ! -d src/arm ] && ./scripts/get-plugins.sh
[ "$(uname)" = "Darwin" ] && TAR=gtar || TAR=tar

PLUGIN_VERSION=$(grep -Eo '[0-9.]+$' src/aarch64/uu.conf)

package() {
mkdir build

mkdir -p build/data/{etc/init.d,usr/sbin/uu}
cp src/$1/uuplugin build/data/usr/sbin/uu
cp src/$1/uu.conf build/data/etc
cp files/uuplugin.init build/data/etc/init.d/uuplugin

cd build
echo 2.0 >debian-binary
sed -i "/^Architecture:/c Architecture: $2" ../files/control
sed -i "/^Version:/c Version: $PLUGIN_VERSION-1" ../files/control
$TAR --owner 0 --group 0 -czf control.tar.gz -C ../files control
$TAR --owner 0 --group 0 -czf data.tar.gz -C data etc usr
$TAR --owner 0 --group 0 -czf uuplugin_$PLUGIN_VERSION-1_$2.ipk debian-binary control.tar.gz data.tar.gz
cp uuplugin_$PLUGIN_VERSION-1_$2.ipk uuplugin_latest-1_$2.ipk
mv *.ipk ../pkg
cd ..

rm -rf build
}

rm -rf build
mkdir -p pkg

for arch in aarch64_cortex-a53 aarch64_cortex-a72 mipsel_24kc mipsel_74kc \
arm_cortex-a9_neon arm_cortex-a7_neon-vfpv4 arm_cortex-a15_neon-vfpv4; do
package ${arch%%_*} $arch
done

package x86_64 x86_64
7 changes: 7 additions & 0 deletions files/control
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
Package: uuplugin
Version: 7.9.14-1
Architecture: x86_64
Maintainer: William Tang
Depends: kmod-tun
Source: https://uu.163.com/router/
Description: UU game booster OpenWrt plugin
11 changes: 11 additions & 0 deletions files/uuplugin.init
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
#!/bin/sh /etc/rc.common

START=99
USE_PROCD=1

start_service() {
rm -rf /tmp/uu && mkdir /tmp/uu && cd /tmp/uu
procd_open_instance
procd_set_param command /usr/sbin/uu/uuplugin /etc/uu.conf
procd_close_instance
}
Binary file added images/alipay.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
39 changes: 39 additions & 0 deletions images/paypal.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added images/wechat.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
2 changes: 2 additions & 0 deletions scripts/get-monitor.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
#!/bin/sh
curl -O $(curl -s -H 'Accept:text/plain' 'https://router.uu.163.com/api/script/monitor?type=openwrt' | awk -F ',' '{print $1}')
15 changes: 15 additions & 0 deletions scripts/get-plugins.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
#!/bin/sh
set -e

mkdir src

for arch in arm aarch64 mipsel x86_64; do
pushd /tmp
curl -O $(curl -s -H "Accept:text/plain" "https://router.uu.163.com/api/plugin?type=openwrt-$arch" | awk -F ',' '{print $1}')
tar -xf uu.tar.gz
popd

mkdir -p "src/$arch/"
mv /tmp/{uu.conf,uuplugin} "src/$arch/"
rm /tmp/uu.tar.gz
done

0 comments on commit 1f45b2c

Please sign in to comment.