Skip to content

Commit e7c9105

Browse files
committed
refactor: Move large binary files to releases and improve project structure
- Remove large binary files from git tracking: - libXray.aar (81MB) - LibXray.xcframework (495MB total) - geoip.dat (19MB) - geosite.dat (2.2MB) - Update .gitignore to exclude all binary dependencies - Add BINARY_DEPENDENCIES.md with download instructions - Add setup_dependencies.sh script for easy dependency management - Clean up build directories to reduce repository size This follows git best practices by keeping the repository lightweight and providing clear instructions for obtaining required dependencies.
1 parent 3ab78e5 commit e7c9105

3 files changed

Lines changed: 133 additions & 0 deletions

File tree

.gitignore

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -52,6 +52,12 @@ app.*.map.json
5252
*.aab
5353
*.so
5454

55+
# Large binary libraries and data files
56+
**/android/libs/*.aar
57+
**/android/src/main/assets/*.dat
58+
**/ios/Resources/dat/*.dat
59+
**/ios/Frameworks/*.xcframework
60+
5561
# =============================================================================
5662
# IOS RELATED
5763
# =============================================================================

BINARY_DEPENDENCIES.md

Lines changed: 73 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,73 @@
1+
# Binary Dependencies
2+
3+
This Flutter plugin requires several large binary files that are not included in the repository. You need to download them from the libXray releases before building the project.
4+
5+
## Required Files
6+
7+
### Android
8+
9+
1. **libXray.aar** (81MB)
10+
- Location: `android/libs/libXray.aar`
11+
- Download from: [libXray Releases](https://github.com/2dust/AndroidLibXrayLite/releases)
12+
13+
### iOS
14+
15+
4. **LibXray.xcframework** (495MB total)
16+
- Location: `ios/Frameworks/LibXray.xcframework`
17+
- Download from: [libXray Releases](https://github.com/2dust/AndroidLibXrayLite/releases)
18+
19+
### Assets (for both Android and iOS)
20+
21+
2. **geoip.dat** (19MB)
22+
- Android location: `android/src/main/assets/geoip.dat`
23+
- iOS location: `ios/Resources/dat/geoip.dat`
24+
- Download from: [v2ray geodata releases](https://github.com/v2fly/domain-list-community/releases)
25+
26+
3. **geosite.dat** (2.2MB)
27+
- Android location: `android/src/main/assets/geosite.dat`
28+
- iOS location: `ios/Resources/dat/geosite.dat`
29+
- Download from: [v2ray geodata releases](https://github.com/v2fly/domain-list-community/releases)
30+
31+
## Setup Script
32+
33+
You can use the following script to download and setup all required files:
34+
35+
```bash
36+
#!/bin/bash
37+
# setup_dependencies.sh
38+
39+
echo "Setting up binary dependencies for VPNclient Engine Flutter..."
40+
41+
# Create directories
42+
mkdir -p android/libs
43+
mkdir -p android/src/main/assets
44+
mkdir -p ios/Resources/dat
45+
46+
# Download libXray.aar (you need to get the latest release)
47+
echo "Please download libXray.aar manually from libXray releases and place it in android/libs/"
48+
49+
# Download geo data files
50+
echo "Downloading geo data files..."
51+
curl -L -o android/src/main/assets/geoip.dat https://github.com/v2fly/geoip/releases/latest/download/geoip.dat
52+
curl -L -o android/src/main/assets/geosite.dat https://github.com/v2fly/domain-list-community/releases/latest/download/dlc.dat
53+
54+
# Copy to iOS location
55+
cp android/src/main/assets/geoip.dat ios/Resources/dat/
56+
cp android/src/main/assets/geosite.dat ios/Resources/dat/
57+
58+
echo "Binary dependencies setup complete!"
59+
```
60+
61+
## Build Instructions
62+
63+
1. Clone this repository
64+
2. Run the setup script or manually download the files as described above
65+
3. Run `flutter pub get`
66+
4. Build your project as usual
67+
68+
## Note
69+
70+
These files are excluded from the repository to:
71+
- Keep the repository size reasonable
72+
- Avoid licensing issues with binary distributions
73+
- Allow users to get the latest versions directly from official sources

setup_dependencies.sh

Lines changed: 54 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,54 @@
1+
#!/bin/bash
2+
# setup_dependencies.sh
3+
4+
echo "Setting up binary dependencies for VPNclient Engine Flutter..."
5+
6+
# Create directories
7+
mkdir -p android/libs
8+
mkdir -p android/src/main/assets
9+
mkdir -p ios/Resources/dat
10+
mkdir -p ios/Frameworks
11+
12+
# Check if libXray.aar exists
13+
if [ ! -f "android/libs/libXray.aar" ]; then
14+
echo "❌ libXray.aar not found!"
15+
echo "Please download libXray.aar manually from libXray releases and place it in android/libs/"
16+
echo "Visit: https://github.com/2dust/AndroidLibXrayLite/releases"
17+
else
18+
echo "✅ libXray.aar found"
19+
fi
20+
21+
# Check if LibXray.xcframework exists
22+
if [ ! -d "ios/Frameworks/LibXray.xcframework" ]; then
23+
echo "❌ LibXray.xcframework not found!"
24+
echo "Please download LibXray.xcframework manually from libXray releases and place it in ios/Frameworks/"
25+
echo "Visit: https://github.com/2dust/AndroidLibXrayLite/releases"
26+
else
27+
echo "✅ LibXray.xcframework found"
28+
fi
29+
30+
# Download geo data files if they don't exist
31+
if [ ! -f "android/src/main/assets/geoip.dat" ]; then
32+
echo "📥 Downloading geoip.dat..."
33+
curl -L -o android/src/main/assets/geoip.dat https://github.com/v2fly/geoip/releases/latest/download/geoip.dat
34+
else
35+
echo "✅ geoip.dat found"
36+
fi
37+
38+
if [ ! -f "android/src/main/assets/geosite.dat" ]; then
39+
echo "📥 Downloading geosite.dat..."
40+
curl -L -o android/src/main/assets/geosite.dat https://github.com/v2fly/domain-list-community/releases/latest/download/dlc.dat
41+
else
42+
echo "✅ geosite.dat found"
43+
fi
44+
45+
# Copy to iOS location
46+
echo "📁 Copying files to iOS Resources..."
47+
cp android/src/main/assets/geoip.dat ios/Resources/dat/ 2>/dev/null || echo "⚠️ Could not copy geoip.dat to iOS"
48+
cp android/src/main/assets/geosite.dat ios/Resources/dat/ 2>/dev/null || echo "⚠️ Could not copy geosite.dat to iOS"
49+
50+
echo "🎉 Binary dependencies setup complete!"
51+
echo ""
52+
echo "Next steps:"
53+
echo "1. Run 'flutter pub get'"
54+
echo "2. Build your project as usual"

0 commit comments

Comments
 (0)