commit 9ce6211346889e7b27ab0cefb5ef6cb73d1be549 Author: darkclip Date: Fri Jan 9 00:01:11 2026 +0800 update diff --git a/.SRCINFO b/.SRCINFO new file mode 100644 index 0000000..bf6cf82 --- /dev/null +++ b/.SRCINFO @@ -0,0 +1,15 @@ +pkgbase = tink-access-one + pkgdesc = ChinaTelecom AOne (access-one) VPN + pkgver = 2.22.2 + pkgrel = 1 + url = https://aone.ctyun.cn/h5/ct0trust/index.html#/terminalManage/clientDownload?key=C4C330843B2111C9EE134125AF2C43FE + install = access-one.install + arch = x86_64 + license = EULA + depends = libxtst + depends = nss + depends = iptables-nft + source = https://soc-0trust.ctcdn.cn/client/20250924002450-AOne-2.22.2-Ubuntu-X64-release-20250902152242.deb + sha256sums = 1d091e26632c29e48ca7fefa563d1ce491e4cb45497ea02b32defad47c199e60 + +pkgname = tink-access-one diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..aa81eed --- /dev/null +++ b/.gitignore @@ -0,0 +1,2 @@ +*.deb +*.pkg.* diff --git a/PKGBUILD b/PKGBUILD new file mode 100644 index 0000000..334b5d0 --- /dev/null +++ b/PKGBUILD @@ -0,0 +1,17 @@ +_pkgname=access-one +pkgname=tink-${_pkgname} +pkgver=2.22.2 +pkgrel=1 +pkgdesc="ChinaTelecom AOne (${_pkgname}) VPN" +arch=(x86_64) +url="https://aone.ctyun.cn/h5/ct0trust/index.html#/terminalManage/clientDownload?key=C4C330843B2111C9EE134125AF2C43FE" +license=(EULA) +depends=('libxtst' 'nss' 'iptables-nft') +install=${_pkgname}.install +source=('https://soc-0trust.ctcdn.cn/client/20250924002450-AOne-2.22.2-Ubuntu-X64-release-20250902152242.deb') +sha256sums=('1d091e26632c29e48ca7fefa563d1ce491e4cb45497ea02b32defad47c199e60') + +package(){ + tar -xf data.tar.xz -C "${pkgdir}" +} + diff --git a/access-one.install b/access-one.install new file mode 100644 index 0000000..3e3c197 --- /dev/null +++ b/access-one.install @@ -0,0 +1,100 @@ +pre_install(){ + echo 'before install script executing...' + + programDir="/opt/AOne" + processName="AOne" + echo "checking running process..." + # 检查进程是否存在 + if pgrep -x "$processName" >/dev/null; then + echo "$processName is running,stopping..." + # 终止进程 + killall -e $processName + fi + + echo 'before install script complete' +} + + +post_install(){ + echo 'after install script executing...' + + programDir="/opt/AOne" + + # 解决Ubuntu 24.04上启动时的sandbox权限报错 + sudo chown root ${programDir}/chrome-sandbox + sudo chmod 4755 ${programDir}/chrome-sandbox + + sudo chmod +x ${programDir}/resources/bin/ctEAO + sudo cp ${programDir}/resources/bin/aone.service /etc/systemd/system + + sudo systemctl daemon-reload + + sudo systemctl enable aone.service + sudo systemctl start aone.service + + # 写入包的类型,用于更新时判断当前包的类型以从平台上获取更新 + sudo echo "deb" > ${programDir}/pkg-type + echo 'after install script complete' +} + + +pre_remove(){ + echo 'before remove script executing...' + + programDir="/opt/AOne" + processName="AOne" + echo "checking running process..." + # 检查进程是否存在 + if pgrep -x "$processName" >/dev/null; then + echo "$processName is running, stopping..." + # 终止进程 + killall -e $processName + fi + + # 卸载 + if [ "$1" = "remove" ]; then + # 拷贝cps-agent的卸载脚本到tmp目录 + if [ -f "${programDir}/resources/bin/uninst_cps.sh" ]; then + cp -f ${programDir}/resources/bin/uninst_cps.sh /tmp/uninst_cps.sh 2>/dev/null + fi + + # 生成卸载标志文件 + flagFile="${programDir}/resources/bin/uninstallflag.log" + if [ ! -f $flagFile ]; then + touch $flagFile + fi + fi + + echo 'before remove script complete' +} + + +post_remove(){ + echo 'after remove script executing...' + + programDir="/opt/AOne" + + num=`systemctl status aone|grep "Active"|grep "running"|wc -l` + if [ $num -ne 0 ]; then + sudo systemctl stop aone.service + sudo systemctl disable aone.service + fi + + if [ -f /etc/systemed/system/aone.service ]; then + sudo rm -rf /etc/systemd/system/aone.service + fi + + # 卸载信创主机安全 + if [ "$1" = "remove" ]; then + uninst_script_path="/tmp/uninst_cps.sh" + bash_path=$(command -v bash 2>/dev/null) + if [ $? -eq 0 ] && [ -f "$uninst_script_path" ]; then + nohup "$bash_path" $uninst_script_path >/dev/null 2>&1 & + else + sudo systemctl stop cps-agent 2>/dev/null + sudo systemctl disable cps-agent 2>/dev/null + fi + fi + + echo 'after remove script complete' +} \ No newline at end of file diff --git a/build.sh b/build.sh new file mode 100755 index 0000000..1b94b2c --- /dev/null +++ b/build.sh @@ -0,0 +1,8 @@ +#!/usr/bin/env bash + +echo "calculating checksums..." +updpkgsums +echo "writing srcinfo..." +makepkg --printsrcinfo > .SRCINFO +echo "building pkg..." +makepkg -cf \ No newline at end of file