Browse Source

upgrade AGP to 7.0.3 and fix builds

pull/679/head
luvletter2333 9 months ago
parent
commit
fb0a01b4d1
No known key found for this signature in database GPG Key ID: A26A8880836E1978
  1. 31
      TMessagesProj/build.gradle
  2. 17
      TMessagesProj/jni/CMakeLists.txt
  3. 1
      bin/libs/native.sh
  4. 6
      build.gradle
  5. 2
      gradle/wrapper/gradle-wrapper.properties
  6. 8
      ss-rust/build.gradle.kts

31
TMessagesProj/build.gradle

@ -39,6 +39,7 @@ configurations {
def keystorePwd = null
def alias = null
def pwd = null
def disableCMakeRelWithDebInfo = System.getenv("COMPILE_NATIVE") == null
Properties properties
def base64 = System.getenv("LOCAL_PROPERTIES")
@ -259,24 +260,21 @@ android {
main {
jni.srcDirs = []
assets.srcDirs = ["src/main/assets", "src/emojis/twitter"]
}
debug {
java {
srcDirs "src/main/java", "src/gservcies/java"
}
jni {
srcDirs = ["./jni/"]
}
jniLibs {
srcDirs = []
}
jni.srcDirs = ["./jni/"]
manifest {
srcFile "src/gservcies/AndroidManifest.xml"
}
}
releaseNoGcm {
jni.srcDirs = []
jniLibs {
srcDir "src/main/libs"
}
@ -286,6 +284,7 @@ android {
java {
srcDirs "src/main/java", "src/gservcies/java"
}
jni.srcDirs = []
jniLibs {
srcDir "src/main/libs"
}
@ -304,18 +303,14 @@ android {
jni {
srcDirs = ["./jni/"]
}
jniLibs {
srcDirs = []
}
jniLibs.srcDirs = []
}
fdroidArm64Release {
jni {
srcDirs = ["./jni/"]
}
jniLibs {
srcDirs = []
}
jniLibs.srcDirs = []
}
}
@ -340,15 +335,6 @@ android {
implementation fileTree("libs")
}
}
if (set.name.matches("(mini|full).*")) {
if (set.name.contains("Apple")) {
set.assets.srcDirs = ["src/main/assets", "src/emojis/apple"]
/*} else if (set.name.contains("Twitter")) {
set.assets.srcDirs = ["src/main/assets", "src/emojis/twitter"]*/
} else {
set.assets.srcDirs = ["src/main/assets", "src/emojis/twitter"]
}
}
}
tasks.all { task ->
@ -358,6 +344,9 @@ android {
if (task.name.contains("uploadCrashlyticsMappingFile")) {
enabled = false
}
if (disableCMakeRelWithDebInfo && task.name.contains("CMakeRelWithDebInfo")) {
enabled = false
}
}
applicationVariants.all { variant ->

17
TMessagesProj/jni/CMakeLists.txt

@ -1,7 +1,7 @@
cmake_minimum_required(VERSION 3.6.0)
set(CMAKE_CXX_FLAGS "-std=c++14 -DANDROID -g")
set(CMAKE_C_FLAGS "-w -std=c11 -DANDROID -D_LARGEFILE_SOURCE=1 -g")
set(CMAKE_CXX_FLAGS "-std=c++14 -DANDROID")
set(CMAKE_C_FLAGS "-w -std=c11 -DANDROID -D_LARGEFILE_SOURCE=1")
set(CMAKE_ASM_FLAGS "${CFLAGS} -x assembler-with-cpp")
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -ffunction-sections -fdata-sections")
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -ffunction-sections -fdata-sections")
@ -15,6 +15,19 @@ ${CMAKE_HOME_DIRECTORY}/ffmpeg/build/${ANDROID_ABI}/lib/libswresample.a,
${CMAKE_HOME_DIRECTORY}/boringssl/build/${ANDROID_ABI}/ssl/libssl.a,
${CMAKE_HOME_DIRECTORY}/boringssl/build/${ANDROID_ABI}/crypto/libcrypto.a")
if(CMAKE_BUILD_TYPE STREQUAL "Debug")
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -O0 -g")
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -O0 -g")
else()
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -O3 -Os -DNDEBUG")
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -O3 -Os -DNDEBUG")
set(LINKER_FLAGS "${LINKER_FLAGS} -Wl,-exclude-libs,ALL -Wl,--gc-sections -Wl,--strip-all")
endif()
message("CFLAGS ${C_FLAGS}")
message("CXX_FLAGS ${CXX_FLAGS}")
if (${ANDROID_ABI} STREQUAL "armeabi-v7a" OR ${ANDROID_ABI} STREQUAL "arm64-v8a")
enable_language(ASM)
else()

1
bin/libs/native.sh

@ -5,6 +5,7 @@ source "bin/init/env.sh"
OUT=TMessagesProj/build/intermediates/stripped_native_libs/miniFoss/out/lib
DIR=TMessagesProj/src/main/libs
export COMPILE_NATIVE=1
./gradlew TMessagesProj:stripMiniFossDebugSymbols || exit 1
function install() {

6
build.gradle

@ -6,11 +6,11 @@ buildscript {
maven { url "https://plugins.gradle.org/m2/" }
}
dependencies {
classpath 'com.android.tools.build:gradle:4.2.2'
classpath 'com.android.tools.build:gradle:7.0.3'
classpath 'org.jetbrains.kotlin:kotlin-gradle-plugin:1.5.30'
classpath 'com.google.gms:google-services:4.3.10'
classpath 'com.google.firebase:firebase-crashlytics-gradle:2.7.1'
classpath 'gradle.plugin.org.mozilla.rust-android-gradle:plugin:0.8.3'
classpath 'com.google.firebase:firebase-crashlytics-gradle:2.8.0'
classpath 'gradle.plugin.org.mozilla.rust-android-gradle:plugin:0.9.0'
//noinspection GradleDependency
classpath "com.github.triplet.gradle:play-publisher:3.4.0-agp4.2"
classpath 'cn.hutool:hutool-core:5.7.13'

2
gradle/wrapper/gradle-wrapper.properties

@ -1,5 +1,5 @@
distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-6.8.3-bin.zip
distributionUrl=https\://services.gradle.org/distributions/gradle-7.2-bin.zip
zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists

8
ss-rust/build.gradle.kts

@ -21,12 +21,12 @@ android {
ndkVersion = rootProject.extra.get("ndkVersion").toString()
compileSdkVersion(30)
compileSdk = 31
defaultConfig {
minSdkVersion(21)
targetSdkVersion(30)
minSdk = 23
targetSdk = 31
}
buildToolsVersion = "30.0.3"
buildToolsVersion = "31.0.0"
if (targetAbi.isNotBlank()) splits.abi {
reset()

Loading…
Cancel
Save