mirror of
https://github.com/NekoX-Dev/NekoX.git
synced 2024-11-23 02:55:23 +01:00
Refind build scripts
This commit is contained in:
parent
5e8de25641
commit
3654e6ad97
29
.github/workflows/dev.yml
vendored
29
.github/workflows/dev.yml
vendored
@ -25,8 +25,11 @@ jobs:
|
||||
java-version: 1.8
|
||||
- name: Run Gradle Build
|
||||
run: |
|
||||
export LOCAL_PROPERTIES="${{ secrets.LOCAL_PROPERTIES }}"
|
||||
sudo bash <<EOF
|
||||
export LOCAL_PROPERTIES="${{ secrets.LOCAL_PROPERTIES }}"
|
||||
./gradlew assembleFullRelease
|
||||
EOF
|
||||
echo ::set-env name=APK_FILE::$(find TMessagesProj/build/outputs/apk -name "*arm64-v8a*.apk")
|
||||
echo ::set-env name=APK_FILE_ARMV7::$(find TMessagesProj/build/outputs/apk -name "*armeabi*.apk")
|
||||
echo ::set-env name=APK_FILE_X86::$(find TMessagesProj/build/outputs/apk -name "*x86-*.apk")
|
||||
@ -43,6 +46,18 @@ jobs:
|
||||
to: ${{ secrets.CANARY_CHANNEL }}
|
||||
token: ${{ secrets.TELEGRAM_TOKEN }}
|
||||
document: ${{ env.APK_FILE_ARMV7 }}
|
||||
- name: Upload Canary Apk ( x86 )
|
||||
uses: appleboy/telegram-action@master
|
||||
with:
|
||||
to: ${{ secrets.CANARY_CHANNEL }}
|
||||
token: ${{ secrets.TELEGRAM_TOKEN }}
|
||||
document: ${{ env.APK_FILE_X86 }}
|
||||
- name: Upload Canary Apk ( x64 )
|
||||
uses: appleboy/telegram-action@master
|
||||
with:
|
||||
to: ${{ secrets.CANARY_CHANNEL }}
|
||||
token: ${{ secrets.TELEGRAM_TOKEN }}
|
||||
document: ${{ env.APK_FILE_X64 }}
|
||||
nativeBuild:
|
||||
name: Native Build
|
||||
runs-on: ubuntu-latest
|
||||
@ -70,25 +85,13 @@ jobs:
|
||||
- name: Build native libraries
|
||||
run: |
|
||||
|
||||
cd TMessagesProj/jni
|
||||
|
||||
while :
|
||||
do
|
||||
sudo apt-get install -y ninja-build && break
|
||||
sleep 5
|
||||
done
|
||||
|
||||
export NDK=$ANDROID_HOME/ndk-bundle
|
||||
export NINJA_PATH=/usr/bin/ninja
|
||||
export PATH=`echo $ANDROID_HOME/cmake/*/bin`:$PATH
|
||||
|
||||
[ -d "ffmpeg/build" ] || ./build_ffmpeg_clang.sh
|
||||
|
||||
./patch_ffmpeg.sh
|
||||
|
||||
./patch_boringssl.sh
|
||||
|
||||
[ -d "boringssl/build" ] || ./build_boringssl.sh
|
||||
bash bin/native_libs.sh
|
||||
|
||||
- name: assemble
|
||||
run: |
|
||||
|
14
README.md
14
README.md
@ -73,7 +73,9 @@ We regret that [Nekogram](https://github.com/Nekogram/Nekogram-issue-tracker) is
|
||||
- Scan the qrcode (any link, can add a proxy).
|
||||
- The ( vemss / vmess1 / ss / ssr / rb ) proxy link in the message can be clicked.
|
||||
- Allow auto disable proxy when VPN is enabled
|
||||
- Proxy automatic switcher
|
||||
- Add stickers without sticker pack
|
||||
- Allow disable vibration
|
||||
- Sticker set list backup / restore / share
|
||||
- Full InstantView translation support
|
||||
- Translation support for selected text on input and in messages
|
||||
@ -81,6 +83,7 @@ We regret that [Nekogram](https://github.com/Nekogram/Nekogram-issue-tracker) is
|
||||
- Dialog sorting is optional "Unread and can be prioritized for reminding" etc.
|
||||
- Allow to skip "regret within five seconds"
|
||||
- Unblock all users support
|
||||
- OpenKaychain client ( sign / verify / decrypt / import )
|
||||
- Google Cloud Translate / Yandex.Translate support
|
||||
- Custom cache directory (supports external storage)
|
||||
- Custom AppId and Hash (optional NekoX / Andorid / Android X or Manual input)
|
||||
@ -117,7 +120,7 @@ The default debug key is used, and placing yours is not needed.
|
||||
|
||||
The difference between release and other build types is that it adds fcm and firebase crash analysis, if you don't like them, use releaseNoGcm.
|
||||
|
||||
To compile the release version, please place your keysotre at TMessageProj/release.jks, and fill in KEYSTORE_PASS, ALIAS_NAME, ALIAS_PASS in local.properties, environment variables are also recommended
|
||||
To compile the release version, please place your keysotre at TMessageProj/release.keystore, and fill in KEYSTORE_PASS, ALIAS_NAME, ALIAS_PASS in local.properties, environment variables are also recommended
|
||||
|
||||
If you don't use NekoX's APP_ID and APP_HASH, you need to register a physical firebase app and replace google-services.json to ensure fcm works
|
||||
|
||||
@ -127,14 +130,19 @@ If you don't use NekoX's APP_ID and APP_HASH, you need to register a physical fi
|
||||
|
||||
OK, a version without firebase cloud messaging and precompiled native libraries, maybe this makes you feel more free, or your phone does not have Google services.
|
||||
|
||||
To compile the foss version, please refer to [build script](./update_jni.sh).
|
||||
To compile the foss version, please refer to [scripts](./bin).
|
||||
|
||||
### Build Variants
|
||||
|
||||
Available variant list:
|
||||
|
||||
`Full`
|
||||
`Mini` ( without ss/ssr/v2ray )
|
||||
`Mini` ( without ss/ssr/v2ray proxies )
|
||||
|
||||
`AppleEmoji`
|
||||
`NotoEmoji`
|
||||
`FacebookEmoji`
|
||||
`NoEmoji`
|
||||
|
||||
## Localization
|
||||
|
||||
|
@ -50,7 +50,7 @@ configurations {
|
||||
def okHttpVersion = '4.8.0'
|
||||
def fcmVersion = '20.2.3'
|
||||
def crashlyticsVersion = '17.1.1'
|
||||
def playCoreVersion = '1.7.3'
|
||||
def playCoreVersion = '1.8.0'
|
||||
|
||||
buildscript {
|
||||
|
||||
@ -61,7 +61,7 @@ buildscript {
|
||||
}
|
||||
|
||||
dependencies {
|
||||
classpath 'cn.hutool:hutool-all:5.3.9'
|
||||
classpath 'cn.hutool:hutool-all:5.3.10'
|
||||
}
|
||||
|
||||
}
|
||||
@ -267,7 +267,6 @@ android {
|
||||
debuggable true
|
||||
jniDebuggable true
|
||||
multiDexEnabled true
|
||||
signingConfig signingConfigs.release
|
||||
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
|
||||
}
|
||||
|
||||
@ -278,16 +277,15 @@ android {
|
||||
minifyEnabled true
|
||||
shrinkResources true
|
||||
matchingFallbacks = ['debug']
|
||||
signingConfig signingConfigs.release
|
||||
}
|
||||
|
||||
release {
|
||||
initWith releaseNoGcm
|
||||
matchingFallbacks = ['debug']
|
||||
}
|
||||
|
||||
foss {
|
||||
initWith release
|
||||
matchingFallbacks = ['debug']
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -1,4 +1,3 @@
|
||||
APP_PLATFORM := android-16
|
||||
NDK_TOOLCHAIN_VERSION := clang
|
||||
APP_SHORT_COMMANDS := true
|
||||
APP_STL := c++_static
|
||||
APP_STL := c++_static
|
@ -1 +1 @@
|
||||
Subproject commit d3b963cc41824a3c5b2758ac896fb23e20a87875
|
||||
Subproject commit 799fc4d732fc2515911b75fe816da2bbd20221d9
|
@ -1,3 +1,3 @@
|
||||
# Pre-compiled binary libraries.
|
||||
|
||||
About compilation, please refer to [here](https://github.com/NekoX-Dev/NekoX/blob/master/update_jni.sh)
|
||||
About compilation, please refer to [scripts](https://github.com/NekoX-Dev/NekoX/blob/master/bin).
|
@ -640,9 +640,9 @@ public class SharedConfig {
|
||||
|
||||
}
|
||||
|
||||
if (Build.VERSION.SDK_INT < Build.VERSION_CODES.LOLLIPOP) {
|
||||
if (Build.VERSION.SDK_INT < 23) {
|
||||
|
||||
throw new RuntimeException(LocaleController.getString("MinApi21Required", R.string.MinApi21Required));
|
||||
throw new RuntimeException(LocaleController.getString("MinApi23Required", R.string.MinApi23Required));
|
||||
|
||||
}
|
||||
|
||||
|
@ -665,8 +665,10 @@ public class ProxyListActivity extends BaseFragment implements NotificationCente
|
||||
if (!BuildVars.isMini) {
|
||||
|
||||
addItem.addSubItem(menu_add_input_vmess, LocaleController.getString("AddProxyVmess", R.string.AddProxyVmess)).setOnClickListener((v) -> presentFragment(new VmessSettingsActivity()));
|
||||
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.LOLLIPOP) {
|
||||
if (Build.VERSION.SDK_INT > 23) {
|
||||
addItem.addSubItem(menu_add_input_ss, LocaleController.getString("AddProxySS", R.string.AddProxySS)).setOnClickListener((v) -> presentFragment(new ShadowsocksSettingsActivity()));
|
||||
}
|
||||
if (Build.VERSION.SDK_INT >= 21) {
|
||||
addItem.addSubItem(menu_add_input_ssr, LocaleController.getString("AddProxySSR", R.string.AddProxySSR)).setOnClickListener((v) -> presentFragment(new ShadowsocksRSettingsActivity()));
|
||||
}
|
||||
// addItem.addSubItem(menu_add_input_rb, LocaleController.getString("AddProxyRB", R.string.AddProxyRB)).setOnClickListener((v) -> presentFragment(new RelayBatonSettingsActivity()));
|
||||
|
@ -1,3 +1,3 @@
|
||||
# Pre-compiled binary libraries.
|
||||
|
||||
About compilation, please refer to [here](https://github.com/NekoX-Dev/NekoX/blob/master/update_jni.sh)
|
||||
About compilation, please refer to [scripts](https://github.com/NekoX-Dev/NekoX/blob/master/bin).
|
@ -201,6 +201,8 @@
|
||||
<string name="DeleteUnavailableServerConfirm">Are you sure you want to **delete unavailable servers**?</string>
|
||||
|
||||
<string name="MinApi21Required">Sorry, you need at least Android 5 (API21).</string>
|
||||
<string name="MinApi23Required">Sorry, you need at least Android 6 (API23).</string>
|
||||
|
||||
<string name="MiniVersionAlert">Sorry, mini version not support this type of proxy, please switch version in settings.</string>
|
||||
|
||||
<string name="ImportProxyFromClipboard">Import From Clipboard</string>
|
||||
|
@ -1,48 +1,83 @@
|
||||
#!/bin/bash
|
||||
|
||||
rm -f TMessagesProj/libs/*.aar
|
||||
if [ ! -x "$(command -v go)" ]; then
|
||||
|
||||
./gradlew ss-rust:assembleRelease
|
||||
# if [ ! -x "$(command -v gvm)" ]; then
|
||||
#
|
||||
# apt install -y bison
|
||||
#
|
||||
# bash < <(curl -s -S -L https://raw.githubusercontent.com/moovweb/gvm/master/binscripts/gvm-installer)
|
||||
#
|
||||
# source "$HOME/.bashrc"
|
||||
#
|
||||
# fi
|
||||
#
|
||||
# gvm install go1.14 -B
|
||||
# gvm use go1.14 --default
|
||||
|
||||
cp ss-rust/build/outputs/aar/* TMessagesProj/libs
|
||||
echo "install golang please!"
|
||||
|
||||
./gradlew ssr-libev:assembleRelease
|
||||
exit 1
|
||||
|
||||
cp ssr-libev/build/outputs/aar/* TMessagesProj/libs
|
||||
fi
|
||||
|
||||
cd TMessagesProj/libs
|
||||
if [ ! -x "$(command -v rustc)" ]; then
|
||||
|
||||
go get -v golang.org/x/mobile/cmd/...
|
||||
# curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh
|
||||
|
||||
v2rayCore="$(go env GOPATH)/src/v2ray.com/core"
|
||||
rm -rf "$v2rayCore"
|
||||
mkdir -p "$v2rayCore"
|
||||
git clone https://github.com/v2fly/v2ray-core.git "$v2rayCore"
|
||||
go get -d github.com/2dust/AndroidLibV2rayLite
|
||||
# rustup target install armv7-linux-androideabi aarch64-linux-android i686-linux-android x86_64-linux-android
|
||||
|
||||
gomobile init
|
||||
gomobile bind -v -ldflags='-s -w' github.com/2dust/AndroidLibV2rayLite
|
||||
rm *-sources.jar
|
||||
echo "install rust please!"
|
||||
|
||||
cd ../..
|
||||
exit 1
|
||||
|
||||
./gradlew TMessagesProj:externalNativeBuildFullFoss
|
||||
fi
|
||||
|
||||
OUT=TMessagesProj/build/intermediates/ndkBuild/fullFoss/obj/local
|
||||
DIR=TMessagesProj/src/main/libs
|
||||
if [ ! -f "$ANDROID_HOME/ndk-bundle/source.properties" ]; then
|
||||
|
||||
rm -rf $DIR/armeabi-v7a
|
||||
mkdir -p $DIR/armeabi-v7a
|
||||
cp $OUT/armeabi-v7a/*.so $DIR/armeabi-v7a
|
||||
export ANDROID_NDK_HOME=$ANDROID_HOME/ndk/21.3.6528147
|
||||
|
||||
rm -rf $DIR/arm64-v8a
|
||||
mkdir -p $DIR/arm64-v8a
|
||||
cp $OUT/arm64-v8a/*.so $DIR/arm64-v8a
|
||||
fi
|
||||
|
||||
rm -rf $DIR/x86
|
||||
mkdir -p $DIR/x86
|
||||
cp $OUT/x86/*.so $DIR/x86
|
||||
|
||||
rm -rf $DIR/x86_64
|
||||
mkdir -p $DIR/x86_64
|
||||
cp $OUT/x86_64/*.so $DIR/x86_64
|
||||
rm -rf TMessagesProj/libs/*.aar
|
||||
./gradlew ss-rust:assembleRelease --stacktrace &&
|
||||
cp ss-rust/build/outputs/aar/* TMessagesProj/libs &&
|
||||
./gradlew ssr-libev:assembleRelease &&
|
||||
cp ssr-libev/build/outputs/aar/* TMessagesProj/libs &&
|
||||
cd TMessagesProj/libs &&
|
||||
|
||||
go get -v golang.org/x/mobile/cmd/... &&
|
||||
|
||||
v2rayCore="$(go env GOPATH)/src/v2ray.com/core" &&
|
||||
rm -rf "$v2rayCore" &&
|
||||
mkdir -p "$v2rayCore" &&
|
||||
git clone https://github.com/v2fly/v2ray-core.git "$v2rayCore" &&
|
||||
go get -d github.com/2dust/AndroidLibV2rayLite &&
|
||||
|
||||
gomobile init &&
|
||||
gomobile bind -v -ldflags='-s -w' github.com/2dust/AndroidLibV2rayLite &&
|
||||
rm *-sources.jar &&
|
||||
|
||||
cd ../.. &&
|
||||
|
||||
./gradlew TMessagesProj:externalNativeBuildFullFoss &&
|
||||
|
||||
OUT=TMessagesProj/build/intermediates/ndkBuild/fullFoss/obj/local &&
|
||||
DIR=TMessagesProj/src/main/libs &&
|
||||
|
||||
rm -rf $DIR/armeabi-v7a &&
|
||||
mkdir -p $DIR/armeabi-v7a &&
|
||||
cp $OUT/armeabi-v7a/*.so $DIR/armeabi-v7a &&
|
||||
|
||||
rm -rf $DIR/arm64-v8a &&
|
||||
mkdir -p $DIR/arm64-v8a &&
|
||||
cp $OUT/arm64-v8a/*.so $DIR/arm64-v8a &&
|
||||
|
||||
rm -rf $DIR/x86 &&
|
||||
mkdir -p $DIR/x86 &&
|
||||
cp $OUT/x86/*.so $DIR/x86 &&
|
||||
|
||||
rm -rf $DIR/x86_64 &&
|
||||
mkdir -p $DIR/x86_64 &&
|
||||
cp $OUT/x86_64/*.so $DIR/x86_64
|
||||
|
@ -21,6 +21,7 @@ if [ ! -x "$(command -v go)" ]; then
|
||||
|
||||
fi
|
||||
|
||||
|
||||
if [ ! -x "$(command -v ninja)" ]; then
|
||||
|
||||
# apt install -y ninja-build
|
||||
@ -31,11 +32,11 @@ if [ ! -x "$(command -v ninja)" ]; then
|
||||
|
||||
fi
|
||||
|
||||
if [ ! -x "$(command -v clang)" ]; then
|
||||
if [ ! -x "$(command -v cmake)" ]; then
|
||||
|
||||
# apt install -y clang
|
||||
# apt install -y cmake
|
||||
|
||||
echo "install clang please!"
|
||||
echo "install cmake please!"
|
||||
|
||||
exit 1
|
||||
|
||||
@ -59,12 +60,18 @@ cd TMessagesProj/jni || exit 1
|
||||
|
||||
git submodule update --init --recursive
|
||||
|
||||
[ -d "ffmpeg/build" ] || ./build_ffmpeg_clang.sh
|
||||
|
||||
rm -rf ffmpeg/toolchain-android
|
||||
cd ffmpeg
|
||||
git reset --hard
|
||||
git clean -fdx
|
||||
cd ..
|
||||
|
||||
./build_ffmpeg_clang.sh
|
||||
./patch_ffmpeg.sh
|
||||
|
||||
./patch_boringssl.sh
|
||||
cd boringssl
|
||||
git reset --hard
|
||||
git clean -fdx
|
||||
cd ..
|
||||
|
||||
[ -d "boringssl/build" ] || ./build_boringssl.sh
|
||||
./patch_boringssl.sh
|
||||
./build_boringssl.sh
|
@ -1,3 +1,3 @@
|
||||
#!/bin/bash
|
||||
|
||||
./gradlew TMessagesProj:publishFullBlobEmojiRelease
|
||||
./gradlew TMessagesProj:publishFullRelease
|
@ -1,7 +1,7 @@
|
||||
apply plugin: 'com.android.library'
|
||||
|
||||
android {
|
||||
compileSdkVersion 28
|
||||
compileSdkVersion 30
|
||||
|
||||
defaultConfig {
|
||||
versionCode 9
|
||||
@ -13,4 +13,5 @@ android {
|
||||
lintOptions {
|
||||
abortOnError false
|
||||
}
|
||||
buildToolsVersion '30.0.1'
|
||||
}
|
@ -9,11 +9,12 @@ android {
|
||||
|
||||
ndkVersion = rootProject.extra.get("ndkVersion").toString()
|
||||
|
||||
compileSdkVersion(29)
|
||||
compileSdkVersion(30)
|
||||
defaultConfig {
|
||||
minSdkVersion(21)
|
||||
targetSdkVersion(28)
|
||||
minSdkVersion(23)
|
||||
targetSdkVersion(30)
|
||||
}
|
||||
buildToolsVersion = "30.0.1"
|
||||
|
||||
}
|
||||
|
||||
|
@ -3,8 +3,8 @@ plugins {
|
||||
}
|
||||
|
||||
android {
|
||||
compileSdkVersion 29
|
||||
buildToolsVersion "29.0.3"
|
||||
compileSdkVersion 30
|
||||
buildToolsVersion '30.0.1'
|
||||
ndkVersion rootProject.ext.ndkVersion
|
||||
|
||||
defaultConfig {
|
||||
|
Loading…
Reference in New Issue
Block a user