Skip to content

Commit

Permalink
更正正则表达式,以删除package.list.cfg无用字段,并添加gid支持 (#169)
Browse files Browse the repository at this point in the history
* 添加Gid支持,简化配置内容
* 更正正则表达式,以移除package.list.cfg无用字段,并添加package.list.cfg的gid支持
  • Loading branch information
moexiyuki authored Dec 8, 2024
1 parent 1da4ec5 commit 18040d2
Show file tree
Hide file tree
Showing 2 changed files with 47 additions and 26 deletions.
59 changes: 38 additions & 21 deletions box/package.list.cfg
Original file line number Diff line number Diff line change
@@ -1,26 +1,43 @@
# 黑/白名单模式;black/white list mode.
mode:white
# 你可以在这里写注释;,但是要确保格式正确:"pkg 包名"
# You can write notes here,
# But make sure you write in the correct format.
# example : pkg $pkgname
# 黑/白 名单模式;black/white list mode.
# 如果需要清除名单配置直接删除本文件即可
# Simply delete this file if you need to clear the list configuration
mode:whitelist
# 格式/format:
# package_name
# gid
# 多开用户标识符/Double Open User Identifier.
# userid+gid
# example:999+gid

# Tiktok
pkg com.zhiliaoapp.musically
com.zhiliaoapp.musically
# Magisk
pkg com.topjohnwu.magisk
com.topjohnwu.magisk
# Via
pkg mark.via
pkg com.android.shell
pkg xyz.blueskyweb.app
pkg com.pikcloud.pikpak
pkg com.termux
pkg com.android.vending
pkg com.google.android.gms
pkg com.github.android
pkg ceui.lisa.pixiv
pkg com.google.android.gsf
pkg com.android.chrome
mark.via
# Lsposed
com.android.shell
# Bluesky
xyz.blueskyweb.app
# Pikpak
com.pikcloud.pikpak
# Termux
com.termux
# Playstore
com.android.vending
# Gms
com.google.android.gms
# Github
com.github.android
# Shaft
ceui.lisa.pixiv
# Gsf
com.google.android.gsf
# Chrome
com.android.chrome

# gid $gid 画饼,暂未考虑;Painted cake, not considered yet
# 😂
# Gid

# Alook
#10450 alook
#99910450 999_alook
14 changes: 9 additions & 5 deletions box/settings.ini
Original file line number Diff line number Diff line change
Expand Up @@ -116,15 +116,19 @@ pkg_config=$(dirname "$settings")/package.list.cfg
# check pkg config file
[ -d ${pkg_config} ]&&rm -rf ${pkg_config}
[ ! -f ${pkg_config} ]&&cat>${pkg_config}<<init
# mode black/whitelist
# 黑/白 名单模式;black/white list mode.
mode:whitelist
# example : pkg pkgname
# 格式/format:
# package_name ▼
#com.topjohnwu.magisk
# Gid ▼
#10450 alook
#99910450 999_alook
init

packages_list=($(sed -n 's/^pkg \([^ ]*\).*/\1/p' ${pkg_config}))

# blacklist / whitelist
proxy_mode=$(sed -n 's/^mode:\([^ ]*\).*/\1/p' ${pkg_config})
packages_list=($(sed -n '/^[^#]/s/^\([^ ]*\.[^ ]*\).*/\1/p' ${pkg_config}))
gid_list=($(sed -n '/^[^#]/s/^\([0-9]\{1,8\}\).*/\1/p' ${pkg_config}))

# eg: notify $title $content
notify() {
Expand Down

0 comments on commit 18040d2

Please sign in to comment.