diff options
author | BeautyyuYanli | 2023-01-01 01:09:33 +0800 |
---|---|---|
committer | BeautyyuYanli | 2023-01-01 01:32:41 +0800 |
commit | a96409a522ed6c6cd06b755669565fafb85abb2b (patch) | |
tree | 6290ba89a403edd8cbaf923527415732169e0ea7 | |
parent | 1179b45b27e846f3783c297bb3693d5b3a789482 (diff) | |
download | aur-a96409a522ed6c6cd06b755669565fafb85abb2b.tar.gz |
change the approach
-rw-r--r-- | .SRCINFO | 21 | ||||
-rw-r--r-- | PKGBUILD | 61 | ||||
-rw-r--r-- | readme.md | 6 | ||||
-rw-r--r-- | tencent-qq.profile | 53 |
4 files changed, 81 insertions, 60 deletions
@@ -1,22 +1,13 @@ pkgbase = linuxqq-firejail pkgdesc = New Linux QQ based on Electron, running in Firejail (security sandbox) - pkgver = 3.0.0_571 - pkgrel = 3 - url = https://im.qq.com/linuxqq/ + pkgver = 0.0.1 + pkgrel = 1 + url = https://github.com/BeautyYuYanli/linuxqq-new-firejail arch = x86_64 arch = aarch64 - license = custom + license = unknown depends = firejail - depends = nss - depends = alsa-lib - depends = gtk3 - depends = gjs - depends = at-spi2-core - optdepends = libappindicator-gtk3: Allow QQ to extend a menu via Ayatana indicators in Unity, KDE or Systray (GTK+ 3 library). - conflicts = linuxqq-new - source_x86_64 = https://dldir1.qq.com/qqfile/qq/QQNT/c005c911/linuxqq_3.0.0-571_amd64.deb - sha512sums_x86_64 = 933a54d7a68da74854a2f3c5e6763366b1059295a477c74385333c30254ad3cd3d5be609f2c81b3b3c0af3816c542a63c6ee4110afb5858b04345fa41f852e5e - source_aarch64 = https://dldir1.qq.com/qqfile/qq/QQNT/c005c911/linuxqq_3.0.0-571_arm64.deb - sha512sums_aarch64 = bab4ed630e8db0c4ff07ed13e93323031aa45cd7098543da9b03d343ba733562fe2d3e1431ba5f00cfeb47561daa793c43846782e2bc87706244ce3e3790050d + source = tencent-qq.profile + sha512sums = 8c6a8075a74c8ffaac4ee2f96c6e41d51de1a040d81f5e3d55543d614f5e60d76ec1d42d935d37cd7031999eadfe4d5597277d35f5ed20b87c781e7eb836edb4 pkgname = linuxqq-firejail @@ -1,47 +1,28 @@ -# Maintainer: Yanli <beautyyuyanli at gmail dot com> -# Maintainer: Purofle <purofle@gmail.com> -# Contributor: Yidaozhan Ya <yidaozhan_ya@outlook.com> -# Contributor: Integral <luckys68@126.com> -# https://github.com/BeautyYuYanli/linuxqq-new-firejail +# Maintainer: Yanli <beautyyuyanli@gmail.com> +# Contributor: cubercsl <hi@cubercsl.site> pkgname=linuxqq-firejail -_pkgname=tencent-qq -pkgver=3.0.0_571 -pkgrel=3 +_pkgname=linuxqq +pkgver=0.0.1 +pkgrel=1 pkgdesc='New Linux QQ based on Electron, running in Firejail (security sandbox)' arch=('x86_64' 'aarch64') -url="https://im.qq.com/linuxqq/" -license=('custom') -depends=('firejail' 'nss' 'alsa-lib' 'gtk3' 'gjs' 'at-spi2-core') -optdepends=('libappindicator-gtk3: Allow QQ to extend a menu via Ayatana indicators in Unity, KDE or Systray (GTK+ 3 library).') -conflicts=('linuxqq-new') -source_x86_64=("https://dldir1.qq.com/qqfile/qq/QQNT/c005c911/linuxqq_${pkgver//_/-}_amd64.deb") -source_aarch64=("https://dldir1.qq.com/qqfile/qq/QQNT/c005c911/linuxqq_${pkgver//_/-}_arm64.deb") -sha512sums_x86_64=('933a54d7a68da74854a2f3c5e6763366b1059295a477c74385333c30254ad3cd3d5be609f2c81b3b3c0af3816c542a63c6ee4110afb5858b04345fa41f852e5e') -sha512sums_aarch64=('bab4ed630e8db0c4ff07ed13e93323031aa45cd7098543da9b03d343ba733562fe2d3e1431ba5f00cfeb47561daa793c43846782e2bc87706244ce3e3790050d') +url="https://github.com/BeautyYuYanli/linuxqq-new-firejail" +license=('unknown') +# TODO: add linuxqq +depends=('firejail') +source=("tencent-qq.profile") +sha512sums=('8c6a8075a74c8ffaac4ee2f96c6e41d51de1a040d81f5e3d55543d614f5e60d76ec1d42d935d37cd7031999eadfe4d5597277d35f5ed20b87c781e7eb836edb4') package() { - echo " -> Extracting the data.tar.xz..." - bsdtar -xf data.tar.xz -C "${pkgdir}/" - chmod -R 755 "${pkgdir}/" + # Patch Firejail + echo " -> Patching Firejail..." + mkdir "${pkgdir}/etc/firejail" -p + mv "tencent-qq.profile" "${pkgdir}/etc/firejail/" - echo " -> Installing..." - - # Wrapper for Firejail - wrapper="${pkgdir}/opt/QQ/qq_wrapper" - echo "#!/bin/bash" > $wrapper - echo "mkdir ~/.linuxqq -p" >> $wrapper - echo "firejail --private=~/.linuxqq --noprofile /opt/QQ/qq" >> $wrapper - chmod 755 $wrapper - - # Launcher - install -d "${pkgdir}/usr/bin/" - ln -s "/opt/QQ/qq" "${pkgdir}/usr/bin/${_pkgname}" - ln -s "/opt/QQ/qq_wrapper" "${pkgdir}/usr/bin/${_pkgname}_wrapper" - - # Launcher Fix - sed -i "3s!/opt/QQ/qq!/usr/bin/${_pkgname}_wrapper!" "${pkgdir}/usr/share/applications/qq.desktop" - - # License - install -Dm644 "${pkgdir}/opt/QQ/LICENSE.electron.txt" -t "${pkgdir}/usr/share/licenses/${pkgname}/" - install -Dm644 "${pkgdir}/opt/QQ/LICENSES.chromium.html" -t "${pkgdir}/usr/share/licenses/${pkgname}/" + # Wrap launcher + echo " -> Wrapping launcher..." + mkdir "${pkgdir}/usr/share/applications" -p + cp "/usr/share/applications/qq.desktop" "${pkgdir}/usr/share/applications/qq-firejail.desktop" + sed -i "2s!Name=QQ!Name=QQ in Firejail!" "${pkgdir}/usr/share/applications/qq-firejail.desktop" + sed -i "3s!/usr/bin/${_pkgname}!firejail --profile=/etc/firejail/tencent-qq.profile /usr/bin/${_pkgname}!" "${pkgdir}/usr/share/applications/qq-firejail.desktop" } diff --git a/readme.md b/readme.md index 3cd174df0c5f..ce9dad2cc6be 100644 --- a/readme.md +++ b/readme.md @@ -1,7 +1,3 @@ -The package run QQ NT for Linux (Electron based) within [Firejail](https://firejail.wordpress.com/). - -A fake home directory `~/.linuxqq` will be created to run QQ. - -The PKGBUILD is forked from https://aur.archlinux.org/packages/linuxqq-new +The package runs [linuxqq](https://aur.archlinux.org/packages/linuxqq) within patched [Firejail](https://firejail.wordpress.com/). Install [linuxqq](https://aur.archlinux.org/packages/linuxqq) before this package. The GitHub repo: https://github.com/BeautyYuYanli/linuxqq-new-firejail
\ No newline at end of file diff --git a/tencent-qq.profile b/tencent-qq.profile new file mode 100644 index 000000000000..5086901f2d7c --- /dev/null +++ b/tencent-qq.profile @@ -0,0 +1,53 @@ +include tencent-qq.local +# Persistent global definitions +include globals.local + +noblacklist ${HOME}/.config/QQ + +# Allow opening hyperlinks +include allow-bin-sh.inc + +include disable-common.inc +include disable-devel.inc +include disable-exec.inc +include disable-interpreters.inc +include disable-programs.inc +include disable-shell.inc +include disable-xdg.inc + +mkdir ${HOME}/.config/QQ +whitelist ${HOME}/.config/QQ +whitelist ${DOWNLOADS} +include whitelist-common.inc +include whitelist-runuser-common.inc +include whitelist-usr-share-common.inc +include whitelist-var-common.inc + +apparmor +caps.drop all +netfilter +nodvd +noinput +nonewprivs +noroot +notv +protocol unix,inet,inet6,netlink +seccomp !chroot +seccomp.block-secondary +shell none + +disable-mnt +# TODO: https://github.com/BeautyYuYanli/linuxqq-new-firejail/issues/1#issuecomment-1368246014 +# private-bin bash,sh,tencent-qq,xdg-open +private-cache +private-dev +private-etc alsa,alternatives,ca-certificates,crypto-policies,fonts,group,ld.so.cache,ld.so.preload,localtime,machine-id,os-release,passwd,pki,pulse,resolv.conf,ssl,xdg +private-opt QQ +private-tmp + +dbus-user filter +dbus-user.talk org.freedesktop.Notifications +?ALLOW_TRAY: dbus-user.talk org.kde.StatusNotifierWatcher +dbus-user.talk org.gnome.Mutter.IdleMonitor +dbus-user.talk org.freedesktop.ScreenSaver +dbus-system none |