2026-01-17 13:22:43 +03:00
|
|
|
#!/bin/bash
|
|
|
|
|
|
|
|
|
|
# Professional Build Script for Umbrix v1.7.0
|
|
|
|
|
# Builds all distribution formats with proper libcore integration
|
|
|
|
|
|
|
|
|
|
set -e # Exit on error
|
|
|
|
|
|
|
|
|
|
# Colors
|
|
|
|
|
RED='\033[0;31m'
|
|
|
|
|
GREEN='\033[0;32m'
|
|
|
|
|
BLUE='\033[0;34m'
|
|
|
|
|
YELLOW='\033[1;33m'
|
|
|
|
|
NC='\033[0m' # No Color
|
|
|
|
|
|
|
|
|
|
PROJECT_DIR="$HOME/dorod/hiddify-umbrix-v1.7.0"
|
|
|
|
|
BUNDLE_DIR="$PROJECT_DIR/build/linux/x64/release/bundle"
|
|
|
|
|
LIBCORE_CUSTOM="$PROJECT_DIR/libcore/bin/lib/libcore.so"
|
|
|
|
|
VERSION="1.7.0"
|
|
|
|
|
|
|
|
|
|
echo -e "${BLUE}╔════════════════════════════════════════════════╗${NC}"
|
|
|
|
|
echo -e "${BLUE}║ Umbrix Professional Build System v${VERSION} ║${NC}"
|
|
|
|
|
echo -e "${BLUE}╚════════════════════════════════════════════════╝${NC}"
|
|
|
|
|
echo
|
|
|
|
|
|
|
|
|
|
# Step 1: Verify custom libcore exists
|
|
|
|
|
echo -e "${YELLOW}[1/6]${NC} Verifying custom libcore..."
|
|
|
|
|
if [[ ! -f "$LIBCORE_CUSTOM" ]]; then
|
|
|
|
|
echo -e "${RED}✗ Custom libcore not found at: $LIBCORE_CUSTOM${NC}"
|
|
|
|
|
exit 1
|
|
|
|
|
fi
|
|
|
|
|
LIBCORE_SIZE=$(du -h "$LIBCORE_CUSTOM" | cut -f1)
|
|
|
|
|
echo -e "${GREEN}✓${NC} Custom libcore found: ${LIBCORE_SIZE}"
|
|
|
|
|
|
|
|
|
|
# Step 2: Clean previous builds
|
|
|
|
|
echo -e "\n${YELLOW}[2/6]${NC} Cleaning previous builds..."
|
|
|
|
|
cd "$PROJECT_DIR"
|
|
|
|
|
rm -rf build/linux/x64/release/bundle 2>/dev/null || true
|
|
|
|
|
rm -rf dist/ 2>/dev/null || true
|
|
|
|
|
echo -e "${GREEN}✓${NC} Clean complete"
|
|
|
|
|
|
|
|
|
|
# Step 3: Build Flutter Linux Release
|
|
|
|
|
echo -e "\n${YELLOW}[3/6]${NC} Building Flutter Linux release..."
|
|
|
|
|
flutter build linux --release 2>&1 | grep -E "Built|Error|FAILURE" | tail -5
|
|
|
|
|
if [[ $? -ne 0 ]]; then
|
|
|
|
|
echo -e "${RED}✗ Flutter build failed${NC}"
|
|
|
|
|
exit 1
|
|
|
|
|
fi
|
|
|
|
|
echo -e "${GREEN}✓${NC} Flutter build complete"
|
|
|
|
|
|
|
|
|
|
# Step 4: Replace libcore with custom version
|
|
|
|
|
echo -e "\n${YELLOW}[4/6]${NC} Integrating custom libcore..."
|
|
|
|
|
if [[ -f "$BUNDLE_DIR/lib/libcore.so" ]]; then
|
|
|
|
|
ORIGINAL_SIZE=$(du -h "$BUNDLE_DIR/lib/libcore.so" | cut -f1)
|
|
|
|
|
echo " Original libcore: $ORIGINAL_SIZE"
|
|
|
|
|
fi
|
|
|
|
|
|
|
|
|
|
cp -f "$LIBCORE_CUSTOM" "$BUNDLE_DIR/lib/libcore.so"
|
|
|
|
|
NEW_SIZE=$(du -h "$BUNDLE_DIR/lib/libcore.so" | cut -f1)
|
|
|
|
|
echo -e "${GREEN}✓${NC} Custom libcore integrated: $NEW_SIZE"
|
|
|
|
|
|
|
|
|
|
# Step 5: Add icon and prepare data directory
|
|
|
|
|
echo -e "\n${YELLOW}[5/6]${NC} Preparing bundle assets..."
|
|
|
|
|
cp -f "$PROJECT_DIR/logo/ic_launcher_playstore.png" "$BUNDLE_DIR/umbrix.png"
|
2026-01-17 17:35:05 +03:00
|
|
|
chmod 644 "$BUNDLE_DIR/umbrix.png"
|
2026-01-17 13:22:43 +03:00
|
|
|
mkdir -p "$BUNDLE_DIR/data"
|
|
|
|
|
echo -e "${GREEN}✓${NC} Icon and data directory ready"
|
|
|
|
|
|
|
|
|
|
# Step 6: Build all distribution packages
|
|
|
|
|
echo -e "\n${YELLOW}[6/6]${NC} Building distribution packages..."
|
|
|
|
|
echo " This may take several minutes..."
|
|
|
|
|
|
|
|
|
|
export PATH="$PATH:$HOME/.pub-cache/bin"
|
|
|
|
|
|
|
|
|
|
# Build DEB package
|
|
|
|
|
echo -e "\n${BLUE} Building DEB package...${NC}"
|
|
|
|
|
flutter_distributor package --platform linux --targets deb 2>&1 | grep -E "✓|✗|Package|Build" | tail -5
|
|
|
|
|
|
|
|
|
|
# Build RPM package
|
|
|
|
|
echo -e "\n${BLUE} Building RPM package...${NC}"
|
|
|
|
|
flutter_distributor package --platform linux --targets rpm 2>&1 | grep -E "✓|✗|Package|Build" | tail -5
|
|
|
|
|
|
|
|
|
|
# Build AppImage
|
|
|
|
|
echo -e "\n${BLUE} Building AppImage...${NC}"
|
|
|
|
|
flutter_distributor package --platform linux --targets appimage 2>&1 | grep -E "✓|✗|Package|Build" | tail -5
|
|
|
|
|
|
|
|
|
|
echo -e "\n${GREEN}════════════════════════════════════════════════${NC}"
|
|
|
|
|
echo -e "${GREEN}✓ Build Complete!${NC}"
|
|
|
|
|
echo -e "${GREEN}════════════════════════════════════════════════${NC}"
|
|
|
|
|
|
|
|
|
|
# Display results
|
|
|
|
|
echo -e "\n${BLUE}📦 Built Packages:${NC}"
|
|
|
|
|
if [[ -d "$PROJECT_DIR/dist" ]]; then
|
|
|
|
|
cd "$PROJECT_DIR/dist"
|
|
|
|
|
for dir in */; do
|
|
|
|
|
if [[ -d "$dir" ]]; then
|
|
|
|
|
echo -e "\n${YELLOW} ${dir%/}:${NC}"
|
|
|
|
|
find "$dir" -type f \( -name "*.deb" -o -name "*.rpm" -o -name "*.AppImage" \) -exec ls -lh {} \; | awk '{print " " $9 " (" $5 ")"}'
|
|
|
|
|
fi
|
|
|
|
|
done
|
|
|
|
|
else
|
|
|
|
|
echo -e "${RED} No packages found in dist/ directory${NC}"
|
|
|
|
|
fi
|
|
|
|
|
|
|
|
|
|
echo -e "\n${BLUE}📂 Portable Bundle:${NC}"
|
|
|
|
|
echo " $BUNDLE_DIR/"
|
|
|
|
|
ls -lh "$BUNDLE_DIR" | grep -E "^-" | awk '{print " " $9 " (" $5 ")"}'
|
|
|
|
|
|
|
|
|
|
echo -e "\n${GREEN}✓ All builds ready for distribution${NC}"
|
|
|
|
|
echo -e "${BLUE}Run ./run-umbrix.sh to test the portable version${NC}"
|