Compare commits

..

1 commit

Author SHA1 Message Date
DHR60
0ef8d60e11
Merge d6c81c3a9c into 8e0c5cb9aa 2025-09-09 18:15:29 +08:00
5 changed files with 49 additions and 34 deletions

View file

@ -28,7 +28,7 @@ Package: v2rayN
Version: $Version Version: $Version
Architecture: $Arch2 Architecture: $Arch2
Maintainer: https://github.com/2dust/v2rayN Maintainer: https://github.com/2dust/v2rayN
Depends: desktop-file-utils, xdg-utils Depends: desktop-file-utils
Description: A GUI client for Windows and Linux, support Xray core and sing-box-core and others Description: A GUI client for Windows and Linux, support Xray core and sing-box-core and others
EOF EOF

View file

@ -1,11 +1,11 @@
#!/usr/bin/env bash #!/usr/bin/env bash
set -euo pipefail set -euo pipefail
# == Require Red Hat Enterprise Linux/FedoraLinux/RockyLinux/AlmaLinux/CentOS OR Ubuntu/Debian == # ===== Require Red Hat Enterprise Linux/RockyLinux/AlmaLinux/CentOS OR Ubuntu/Debian ====
if [[ -r /etc/os-release ]]; then if [[ -r /etc/os-release ]]; then
. /etc/os-release . /etc/os-release
case "$ID" in case "$ID" in
rhel|rocky|almalinux|fedora|centos|ubuntu|debian) rhel|rocky|almalinux|centos|ubuntu|debian)
echo "[OK] Detected supported system: $NAME $VERSION_ID" echo "[OK] Detected supported system: $NAME $VERSION_ID"
;; ;;
*) *)
@ -390,30 +390,25 @@ download_mihomo() {
chmod +x "$outroot/bin/mihomo/mihomo" || true chmod +x "$outroot/bin/mihomo/mihomo" || true
} }
# Move geo files to a unified path: outroot/bin # Move geo files to a unified path: outroot/bin/xray/
unify_geo_layout() { unify_geo_layout() {
local outroot="$1" local outroot="$1"
mkdir -p "$outroot/bin" mkdir -p "$outroot/bin/xray"
local names=( \ local srcs=( \
"geosite.dat" \ "$outroot/bin/geosite.dat" \
"geoip.dat" \ "$outroot/bin/geoip.dat" \
"geoip-only-cn-private.dat" \ "$outroot/bin/geoip-only-cn-private.dat" \
"Country.mmdb" \ "$outroot/bin/Country.mmdb" \
"geoip.metadb" \ "$outroot/bin/geoip.metadb" \
) )
for n in "${names[@]}"; do for s in "${srcs[@]}"; do
# If file exists under bin/xray/, move it up to bin/ if [[ -f "$s" ]]; then
if [[ -f "$outroot/bin/xray/$n" ]]; then mv -f "$s" "$outroot/bin/xray/$(basename "$s")"
mv -f "$outroot/bin/xray/$n" "$outroot/bin/$n"
fi
# If file already in bin/, leave it as-is
if [[ -f "$outroot/bin/$n" ]]; then
:
fi fi
done done
} }
# Download geo/rule assets; then unify to bin/ # Download geo/rule assets; then unify to bin/xray/
download_geo_assets() { download_geo_assets() {
local outroot="$1" local outroot="$1"
local bin_dir="$outroot/bin" local bin_dir="$outroot/bin"
@ -447,7 +442,7 @@ download_geo_assets() {
"https://raw.githubusercontent.com/2dust/sing-box-rules/rule-set-geosite/$f" || true "https://raw.githubusercontent.com/2dust/sing-box-rules/rule-set-geosite/$f" || true
done done
# Unify to bin/ # Unify to bin/xray/
unify_geo_layout "$outroot" unify_geo_layout "$outroot"
} }
@ -485,7 +480,7 @@ download_v2rayn_bundle() {
rm -rf "$nested_dir" rm -rf "$nested_dir"
fi fi
# Unify to bin/ # Unify to bin/xray/
unify_geo_layout "$outroot" unify_geo_layout "$outroot"
echo "[+] Bundle extracted to $outroot" echo "[+] Bundle extracted to $outroot"
@ -615,7 +610,7 @@ Source0: __PKGROOT__.tar.gz
# Runtime dependencies (Avalonia / X11 / Fonts / GL) # Runtime dependencies (Avalonia / X11 / Fonts / GL)
Requires: libX11, libXrandr, libXcursor, libXi, libXext, libxcb, libXrender, libXfixes, libXinerama, libxkbcommon Requires: libX11, libXrandr, libXcursor, libXi, libXext, libxcb, libXrender, libXfixes, libXinerama, libxkbcommon
Requires: fontconfig, freetype, cairo, pango, mesa-libEGL, mesa-libGL, xdg-utils Requires: fontconfig, freetype, cairo, pango, mesa-libEGL, mesa-libGL
%description %description
v2rayN Linux for Red Hat Enterprise Linux v2rayN Linux for Red Hat Enterprise Linux
@ -634,13 +629,25 @@ https://github.com/2dust/v2rayN
install -dm0755 %{buildroot}/opt/v2rayN install -dm0755 %{buildroot}/opt/v2rayN
cp -a * %{buildroot}/opt/v2rayN/ cp -a * %{buildroot}/opt/v2rayN/
# Launcher (prefer native ELF first, then DLL fallback) # Launcher (prefer native ELF first, then DLL fallback; also create Geo symlinks for the user)
install -dm0755 %{buildroot}%{_bindir} install -dm0755 %{buildroot}%{_bindir}
cat > %{buildroot}%{_bindir}/v2rayn << 'EOF' cat > %{buildroot}%{_bindir}/v2rayn << 'EOF'
#!/usr/bin/bash #!/usr/bin/bash
set -euo pipefail set -euo pipefail
DIR="/opt/v2rayN" DIR="/opt/v2rayN"
# --- Symlink GEO files into user's XDG dir (first-run convenience) ---
XDG_DATA_HOME="${XDG_DATA_HOME:-$HOME/.local/share}"
USR_GEO_DIR="$XDG_DATA_HOME/v2rayN/bin"
SYS_XRAY_DIR="$DIR/bin/xray"
mkdir -p "$USR_GEO_DIR"
for f in geosite.dat geoip.dat geoip-only-cn-private.dat Country.mmdb; do
if [[ -f "$SYS_XRAY_DIR/$f" && ! -e "$USR_GEO_DIR/$f" ]]; then
ln -s "$SYS_XRAY_DIR/$f" "$USR_GEO_DIR/$f" || true
fi
done
# --- end GEO ---
# Prefer native apphost # Prefer native apphost
if [[ -x "$DIR/v2rayN" ]]; then exec "$DIR/v2rayN" "$@"; fi if [[ -x "$DIR/v2rayN" ]]; then exec "$DIR/v2rayN" "$@"; fi

View file

@ -1,7 +1,7 @@
<Project> <Project>
<PropertyGroup> <PropertyGroup>
<Version>7.14.9</Version> <Version>7.14.8</Version>
</PropertyGroup> </PropertyGroup>
<PropertyGroup> <PropertyGroup>

View file

@ -488,7 +488,7 @@ public class MainWindowViewModel : MyReactiveObject
} }
else if (Utils.IsLinux()) else if (Utils.IsLinux())
{ {
ProcUtils.ProcessStart("xdg-open", path); ProcUtils.ProcessStart("nautilus", path);
} }
else if (Utils.IsOSX()) else if (Utils.IsOSX())
{ {

View file

@ -38,10 +38,9 @@
<WrapPanel Margin="4" DockPanel.Dock="Top"> <WrapPanel Margin="4" DockPanel.Dock="Top">
<ListBox <ListBox
x:Name="lstGroup" x:Name="lstGroup"
Margin="{StaticResource MarginLr4}" Margin="4,0"
DisplayMemberBinding="{Binding Remarks}" DisplayMemberBinding="{Binding Remarks}"
ItemsSource="{Binding SubItems}" ItemsSource="{Binding SubItems}">
Theme="{DynamicResource ButtonRadioGroupListBox}">
<ListBox.ItemsPanel> <ListBox.ItemsPanel>
<ItemsPanelTemplate> <ItemsPanelTemplate>
<WrapPanel /> <WrapPanel />
@ -90,11 +89,20 @@
Binding="{Binding ConfigType}" Binding="{Binding ConfigType}"
Header="{x:Static resx:ResUI.LvServiceType}" Header="{x:Static resx:ResUI.LvServiceType}"
Tag="ConfigType" /> Tag="ConfigType" />
<DataGridTextColumn
Width="120" <DataGridTemplateColumn SortMemberPath="Remarks" Tag="Remarks">
Binding="{Binding Remarks}" <DataGridTemplateColumn.Header>
Header="{x:Static resx:ResUI.LvRemarks}" <TextBlock Text="{x:Static resx:ResUI.LvRemarks}" />
Tag="Remarks" /> </DataGridTemplateColumn.Header>
<DataGridTemplateColumn.CellTemplate>
<DataTemplate>
<StackPanel Margin="8,0" Orientation="Horizontal">
<TextBlock Text="{Binding Remarks}" />
</StackPanel>
</DataTemplate>
</DataGridTemplateColumn.CellTemplate>
</DataGridTemplateColumn>
<DataGridTextColumn <DataGridTextColumn
Width="120" Width="120"
Binding="{Binding Address}" Binding="{Binding Address}"