Skip to content

Commit e931941

Browse files
authored
Merge pull request #26 from wikm360/dev
Dev to main
2 parents be4ffdf + b5c64d8 commit e931941

File tree

17 files changed

+201
-106
lines changed

17 files changed

+201
-106
lines changed

.github/workflows/dev.yml

Lines changed: 1 addition & 40 deletions
Original file line numberDiff line numberDiff line change
@@ -99,38 +99,6 @@ jobs:
9999
name: ubuntu-release
100100
path: ./release/XC-ubuntu.zip
101101

102-
build-ubuntu20:
103-
runs-on: ubuntu-20.04
104-
steps:
105-
- name: Checkout code
106-
uses: actions/checkout@v4
107-
108-
- name: Setup Python ${{ env.PYTHON_VERSION }}
109-
uses: actions/setup-python@v5
110-
with:
111-
python-version: ${{ env.PYTHON_VERSION }}
112-
113-
- name: Install dependencies
114-
run: |
115-
python -m pip install --upgrade pip
116-
pip install pyinstaller
117-
pip install -r requirements.txt
118-
119-
- name: Build executable with flet
120-
run: flet pack -i ./GUI-ver/src/assets/icon.ico ./GUI-ver/src/main.py -n XC --product-name XC --file-description "XC Created By wikm" --product-version v4.2-${{ github.run_number }} --file-version v4.2-${{ github.run_number }} --company-name wikm.ir
121-
122-
- name: Zip executable and folders
123-
run: |
124-
mkdir release
125-
cp -r ./dist/XC ./release/
126-
zip -r ./release/XC-ubuntu20.zip ./release/
127-
128-
- name: Upload Release Asset
129-
uses: actions/upload-artifact@v4
130-
with:
131-
name: ubuntu20-release
132-
path: ./release/XC-ubuntu20.zip
133-
134102
build-fedora:
135103
runs-on: ubuntu-latest
136104
steps:
@@ -187,7 +155,7 @@ jobs:
187155

188156
github-release:
189157
name: Upload to GitHub Release
190-
needs: [build-windows, build-ubuntu, build-ubuntu20, build-fedora, build-cli]
158+
needs: [build-windows, build-ubuntu, build-fedora, build-cli]
191159
runs-on: ubuntu-latest
192160

193161
permissions:
@@ -210,12 +178,6 @@ jobs:
210178
name: ubuntu-release
211179
path: ./release/ubuntu/
212180

213-
- name: Download Release Assets
214-
uses: actions/download-artifact@v4
215-
with:
216-
name: ubuntu20-release
217-
path: ./release/ubuntu20/
218-
219181
- name: Download Release Assets
220182
uses: actions/download-artifact@v4
221183
with:
@@ -248,7 +210,6 @@ jobs:
248210
"v4.2-${{ github.run_number }}" \
249211
./release/windows/XC-windows.zip \
250212
./release/ubuntu/XC-ubuntu.zip \
251-
./release/ubuntu20/XC-ubuntu20.zip \
252213
./release/fedora/XC-fedora.zip \
253214
./release/cli/XC-CLI.zip \
254215
--repo "${{ github.repository }}"

.github/workflows/main.yml

Lines changed: 1 addition & 40 deletions
Original file line numberDiff line numberDiff line change
@@ -98,38 +98,6 @@ jobs:
9898
name: ubuntu-release
9999
path: ./release/XC-ubuntu.zip
100100

101-
build-ubuntu20:
102-
runs-on: ubuntu-20.04
103-
steps:
104-
- name: Checkout code
105-
uses: actions/checkout@v4
106-
107-
- name: Setup Python ${{ env.PYTHON_VERSION }}
108-
uses: actions/setup-python@v5
109-
with:
110-
python-version: ${{ env.PYTHON_VERSION }}
111-
112-
- name: Install dependencies
113-
run: |
114-
python -m pip install --upgrade pip
115-
pip install pyinstaller
116-
pip install -r requirements.txt
117-
118-
- name: Build executable with flet
119-
run: flet pack -i ./GUI-ver/src/assets/icon.ico ./GUI-ver/src/main.py -n XC --product-name XC --file-description "XC Created By wikm" --product-version v4.3-${{ github.run_number }} --file-version v4.3-${{ github.run_number }} --company-name wikm.ir
120-
121-
- name: Zip executable and folders
122-
run: |
123-
mkdir release
124-
cp -r ./dist/XC ./release/
125-
zip -r ./release/XC-ubuntu20.zip ./release/
126-
127-
- name: Upload Release Asset
128-
uses: actions/upload-artifact@v4
129-
with:
130-
name: ubuntu20-release
131-
path: ./release/XC-ubuntu20.zip
132-
133101
build-fedora:
134102
runs-on: ubuntu-latest
135103
steps:
@@ -186,7 +154,7 @@ jobs:
186154

187155
github-release:
188156
name: Upload to GitHub Release
189-
needs: [build-windows, build-ubuntu, build-ubuntu20, build-fedora, build-cli]
157+
needs: [build-windows, build-ubuntu, build-fedora, build-cli]
190158
runs-on: ubuntu-latest
191159

192160
permissions:
@@ -209,12 +177,6 @@ jobs:
209177
name: ubuntu-release
210178
path: ./release/ubuntu/
211179

212-
- name: Download Release Assets
213-
uses: actions/download-artifact@v4
214-
with:
215-
name: ubuntu20-release
216-
path: ./release/ubuntu20/
217-
218180
- name: Download Release Assets
219181
uses: actions/download-artifact@v4
220182
with:
@@ -247,7 +209,6 @@ jobs:
247209
"v4.3-${{ github.run_number }}" \
248210
./release/windows/XC-windows.zip \
249211
./release/ubuntu/XC-ubuntu.zip \
250-
./release/ubuntu20/XC-ubuntu20.zip \
251212
./release/fedora/XC-fedora.zip \
252213
./release/cli/XC-CLI.zip \
253214
--repo "${{ github.repository }}"

GUI-ver/src/AppDir/.DirIcon

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
icon.png

GUI-ver/src/AppDir/AppRun

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
#!/bin/bash
2+
HERE="$(dirname "$(readlink -f "${0}")")"
3+
exec "$HERE/usr/bin/xc"

GUI-ver/src/AppDir/icon.png

286 KB
Loading

GUI-ver/src/AppDir/usr/bin/xc

32.2 MB
Binary file not shown.

GUI-ver/src/AppDir/xc.desktop

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
[Desktop Entry]
2+
Type=Application
3+
Name=xc
4+
Exec=xc
5+
Icon=icon
6+
Categories=Utility;

GUI-ver/src/appimagetool

2.07 MB
Binary file not shown.

GUI-ver/src/backend.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -698,10 +698,12 @@ def disable_gnome_proxy(self):
698698
def _get_xray_traffic(self, stat_name):
699699
"""Helper function to get traffic stats from Xray"""
700700
try:
701+
creation_flags = subprocess.CREATE_NO_WINDOW if self.os_sys == "win" else 0
701702
result = subprocess.run(
702703
[self.xray_path, "api", "stats", f"--server={self.server}", f"-name={stat_name}"],
703704
capture_output=True,
704-
text=True
705+
text=True,
706+
creationflags=creation_flags
705707
)
706708
if result.returncode == 0:
707709
data = json.loads(result.stdout)

GUI-ver/src/build_appimage.sh

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
#!/bin/bash
2+
3+
# دریافت appimagetool در صورت نیاز
4+
if [ ! -f appimagetool ]; then
5+
wget https://github.com/AppImage/AppImageKit/releases/latest/download/appimagetool-x86_64.AppImage -O appimagetool
6+
chmod +x appimagetool
7+
fi
8+
9+
# ساخت AppImage
10+
./appimagetool AppDir

0 commit comments

Comments
 (0)