Prebuilt binaries for third-party submodules (#252)
* Add prebuilt submodule * Remove Android native library * Add links for Android prebuilt library * Update OpenSSL to prebuilt binaries * Setup links for prebuilt OpenSSL * Set correct OpenSSL header dir * Update prebuilt submodule * Use static OpenSSL for linux build * Use prebuilt binary from 3rd-prebuilt for Win installer * Use prebuilt binary from 3rd-prebuilt for Linux installer * Use prebuilt binary from 3rd-prebuilt for MacOS installer * Use Android prebuilt openvpn libs * Cleanup some unneeded code * Add new maven repo for gradle-versions-plugin * Use jitpack version of jsocks * Fix some unnecessary header copy * Fix issue with package name of original WG libs * Change submodule path to https (3rd-prebuilt) * Fix windows installer * MacOS deploy fixes * NetworkChange detection for OpenVPN protocol (#256) * NetworkChange detection for OpenVPN protocol * Update android native libs * Always on VPN mode for OpenVPN, Cloak+OpenVPN * Set foregroundService type * Android 14 require to set foregroundServiceType * Remove unused code and cleanup submodules * Cleanup gradle build script * Fix start button status * Pull OpenSSL prebuilt for MacOS, iOS * Update links for OpenSSL MacOS, iOS prebuilt * Update OpenSSL binaries path * Refactor some OpenSSL includes * Update MacOS OpenVPN binary with statically linked dependency * Use prebilt for LibSSH * Android resources cleanup * Set static runtime linux * Use shared LibSSH for Android * Update SS Android lib name * Fix Linux install path and file permissions * Feature/iOS GitHub actions (#265) * Move Android cpp code to openvpn-pt-android repo * Remove unused OpenVPN2 Android Libs * Cleanup Gemfile --------- Co-authored-by: Mazay B <pokamest@gmail.com>
This commit is contained in:
parent
9bd8c774ab
commit
f58a16ca9d
327 changed files with 500 additions and 45808 deletions
90
deploy/build_ios.sh
Normal file → Executable file
90
deploy/build_ios.sh
Normal file → Executable file
|
|
@ -5,12 +5,11 @@ set -o errexit -o nounset
|
|||
|
||||
# Hold on to current directory
|
||||
PROJECT_DIR=$(pwd)
|
||||
DEPLOY_DIR=$PROJECT_DIR/deploy
|
||||
|
||||
mkdir -p $DEPLOY_DIR/build
|
||||
BUILD_DIR=$DEPLOY_DIR/build
|
||||
BUILD_DIR=$PROJECT_DIR/build-ios
|
||||
mkdir -p $BUILD_DIR
|
||||
|
||||
echo "Project dir: ${PROJECT_DIR}"
|
||||
echo "Project dir: ${PROJECT_DIR}"
|
||||
echo "Build dir: ${BUILD_DIR}"
|
||||
|
||||
APP_NAME=AmneziaVPN
|
||||
|
|
@ -18,32 +17,83 @@ APP_FILENAME=$APP_NAME.app
|
|||
APP_DOMAIN=org.amneziavpn.package
|
||||
PLIST_NAME=$APP_NAME.plist
|
||||
|
||||
OUT_APP_DIR=$BUILD_DIR/client
|
||||
BUNDLE_DIR=$OUT_APP_DIR/$APP_FILENAME
|
||||
|
||||
PRO_FILE_PATH=$PROJECT_DIR/$APP_NAME.pro
|
||||
QMAKE_STASH_FILE=$PROJECT_DIR/.qmake_stash
|
||||
|
||||
# Search Qt
|
||||
if [ -z "${QT_VERSION+x}" ]; then
|
||||
QT_VERSION=5.15.2;
|
||||
QIF_VERSION=4.1
|
||||
QT_BIN_DIR=$HOME/Qt/$QT_VERSION/ios/bin
|
||||
QT_VERSION=6.5.2;
|
||||
QT_BIN_DIR=$HOME/Qt/$QT_VERSION/ios/bin
|
||||
fi
|
||||
|
||||
echo "Using Qt in $QT_BIN_DIR"
|
||||
|
||||
|
||||
# Checking env
|
||||
$QT_BIN_DIR/qmake -v
|
||||
$QT_BIN_DIR/qt-cmake --version
|
||||
cmake --version
|
||||
clang -v
|
||||
|
||||
# Build App
|
||||
echo "Building App..."
|
||||
cd $PROJECT_DIR/client
|
||||
$PROJECT_DIR/client/scripts/apple_compile.sh ios
|
||||
# Generate XCodeProj
|
||||
$QT_BIN_DIR/qt-cmake . -B $BUILD_DIR -GXcode -DQT_HOST_PATH=$QT_MACOS_ROOT_DIR
|
||||
|
||||
# Build and run tests here
|
||||
KEYCHAIN=amnezia.build.keychain
|
||||
KEYCHAIN_FILE=$HOME/Library/Keychains/${KEYCHAIN}-db
|
||||
|
||||
#echo "............Deploy.................."
|
||||
# Setup keychain
|
||||
if [ "${IOS_SIGNING_CERT_BASE64+x}" ]; then
|
||||
echo "Import certificate"
|
||||
|
||||
TRUST_CERT_CER=$BUILD_DIR/trust-cert.cer
|
||||
SIGNING_CERT_P12=$BUILD_DIR/signing-cert.p12
|
||||
|
||||
echo $IOS_TRUST_CERT_BASE64 | base64 --decode > $TRUST_CERT_CER
|
||||
echo $IOS_SIGNING_CERT_BASE64 | base64 --decode > $SIGNING_CERT_P12
|
||||
|
||||
shasum -a 256 $TRUST_CERT_CER
|
||||
shasum -a 256 $SIGNING_CERT_P12
|
||||
|
||||
KEYCHAIN_PASS=$IOS_SIGNING_CERT_PASSWORD
|
||||
|
||||
security create-keychain -p $KEYCHAIN_PASS $KEYCHAIN || true
|
||||
security default-keychain -s $KEYCHAIN
|
||||
security unlock-keychain -p $KEYCHAIN_PASS $KEYCHAIN
|
||||
|
||||
security default-keychain
|
||||
security list-keychains
|
||||
|
||||
security import $TRUST_CERT_CER -k $KEYCHAIN -P "" -T /usr/bin/codesign
|
||||
security import $SIGNING_CERT_P12 -k $KEYCHAIN -P $IOS_SIGNING_CERT_PASSWORD -T /usr/bin/codesign
|
||||
|
||||
security set-key-partition-list -S "apple-tool:,apple:,codesign:" -s -k $KEYCHAIN_PASS $KEYCHAIN
|
||||
security find-identity -p codesigning
|
||||
security set-keychain-settings $KEYCHAIN_FILE
|
||||
security set-keychain-settings -t 3600 $KEYCHAIN_FILE
|
||||
security unlock-keychain -p $KEYCHAIN_PASS $KEYCHAIN_FILE
|
||||
|
||||
# Copy provisioning prifiles
|
||||
mkdir -p "$HOME/Library/MobileDevice/Provisioning Profiles/"
|
||||
|
||||
echo $IOS_APP_PROVISIONING_PROFILE | base64 --decode > ~/Library/MobileDevice/Provisioning\ Profiles/app.mobileprovision
|
||||
echo $IOS_NE_PROVISIONING_PROFILE | base64 --decode > ~/Library/MobileDevice/Provisioning\ Profiles/ne.mobileprovision
|
||||
|
||||
shasum -a 256 ~/Library/MobileDevice/Provisioning\ Profiles/app.mobileprovision
|
||||
shasum -a 256 ~/Library/MobileDevice/Provisioning\ Profiles/ne.mobileprovision
|
||||
|
||||
profile_uuid=`grep UUID -A1 -a ~/Library/MobileDevice/Provisioning\ Profiles/app.mobileprovision | grep -io "[-A-F0-9]\{36\}"`
|
||||
profile_ne_uuid=`grep UUID -A1 -a ~/Library/MobileDevice/Provisioning\ Profiles/ne.mobileprovision | grep -io "[-A-F0-9]\{36\}"`
|
||||
|
||||
mv ~/Library/MobileDevice/Provisioning\ Profiles/app.mobileprovision ~/Library/MobileDevice/Provisioning\ Profiles/$profile_uuid.mobileprovision
|
||||
mv ~/Library/MobileDevice/Provisioning\ Profiles/ne.mobileprovision ~/Library/MobileDevice/Provisioning\ Profiles/$profile_ne_uuid.mobileprovision
|
||||
else
|
||||
echo "Failed to import certificate, aborting..."
|
||||
exit 1
|
||||
fi
|
||||
|
||||
# Build project
|
||||
xcodebuild \
|
||||
"OTHER_CODE_SIGN_FLAGS=--keychain '$KEYCHAIN_FILE'" \
|
||||
-configuration Release \
|
||||
-scheme AmneziaVPN \
|
||||
-destination "generic/platform=iOS,name=Any iOS'" \
|
||||
-project $BUILD_DIR/AmneziaVPN.xcodeproj
|
||||
|
||||
# restore keychain
|
||||
security default-keychain -s login.keychain
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue