From 430782f8836927dea69c04709daa51c468438f48 Mon Sep 17 00:00:00 2001 From: xtaodada Date: Fri, 15 Mar 2024 22:50:24 +0800 Subject: [PATCH] chore: Update AGP --- TMessagesProj/build.gradle | 54 +++++++++--------------- TMessagesProj/proguard-rules.pro | 8 ++++ build.gradle | 8 ++-- gradle.properties | 2 + gradle/wrapper/gradle-wrapper.properties | 2 +- openpgp-api/build.gradle | 9 ++-- 6 files changed, 41 insertions(+), 42 deletions(-) diff --git a/TMessagesProj/build.gradle b/TMessagesProj/build.gradle index 66e5b4a7ab..ea88592c71 100644 --- a/TMessagesProj/build.gradle +++ b/TMessagesProj/build.gradle @@ -66,7 +66,7 @@ if (!gradle.startParameter.taskNames.isEmpty()) { } def nativeTarget = System.getenv("NATIVE_TARGET") -if (nativeTarget == null) nativeTarget = "" +if (nativeTarget == null) nativeTarget = "arm64-v8a" android { compileSdkVersion 33 @@ -88,6 +88,7 @@ android { include nativeTarget universalApk false } else { + include 'armeabi-v7a', 'arm64-v8a', 'x86', 'x86_64' universalApk true } } @@ -220,7 +221,6 @@ android { sourceSets { main { - jni.srcDirs = [] assets.srcDirs = ["src/main/assets", "src/emojis/twitter"] } @@ -228,7 +228,6 @@ android { java { srcDirs "src/main/java", "src/gservcies/java" } - jni.srcDirs = [] jniLibs { srcDir "src/main/libs" } @@ -238,7 +237,6 @@ android { } releaseNoGcm { - jni.srcDirs = [] jniLibs { srcDir "src/main/libs" } @@ -248,7 +246,6 @@ android { java { srcDirs "src/main/java", "src/gservcies/java" } - jni.srcDirs = [] jniLibs { srcDir "src/main/libs" } @@ -257,16 +254,8 @@ android { } } - foss { - jni { - srcDirs = ["./jni/"] - } - } fdroidRelease { - jni { - srcDirs = ["./jni/"] - } jniLibs.srcDirs = [] } @@ -280,7 +269,7 @@ android { } } - tasks.all { task -> + tasks.configureEach { task -> if (((task.name.endsWith("Ndk") || task.name.startsWith("generateJsonModel") || task.name.startsWith("externalNativeBuild"))) && !(task.name.contains("Debug") || task.name.contains("Foss") || task.name.contains("Fdroid"))) { task.enabled = false } @@ -292,8 +281,8 @@ android { } } - applicationVariants.all { variant -> - variant.outputs.all { output -> + applicationVariants.configureEach { variant -> + variant.outputs.configureEach { output -> String gramName = "PagerGram" String first = String.format("%s-v%s(%s)", gramName, versionName, versionCode) String name = outputFileName.replace("TMessagesProj", first) @@ -305,18 +294,18 @@ android { } -def fcmVersion = "23.0.7" -def crashlyticsVersion = "18.2.12" +def fcmVersion = "23.4.1" +def crashlyticsVersion = "18.6.2" def playCoreVersion = "1.10.3" dependencies { implementation "androidx.browser:browser:1.5.0" implementation 'androidx.fragment:fragment:1.2.0' - implementation "androidx.core:core-ktx:1.9.0" + implementation "androidx.core:core-ktx:1.10.0" implementation "androidx.palette:palette-ktx:1.0.0" implementation "androidx.viewpager:viewpager:1.0.0" - implementation "androidx.exifinterface:exifinterface:1.3.6" + implementation "androidx.exifinterface:exifinterface:1.3.7" implementation "androidx.interpolator:interpolator:1.0.0" implementation "androidx.dynamicanimation:dynamicanimation:1.0.0" implementation "androidx.multidex:multidex:2.0.1" @@ -330,10 +319,10 @@ dependencies { //noinspection GradleDependency implementation "com.googlecode.mp4parser:isoparser:1.0.6" - implementation "com.google.code.gson:gson:2.8.9" + implementation "com.google.code.gson:gson:2.10" implementation "org.osmdroid:osmdroid-android:6.1.10" - implementation "org.jetbrains.kotlin:kotlin-stdlib-jdk8:1.7.10" - implementation "org.jetbrains.kotlinx:kotlinx-coroutines-android:1.6.1" + implementation 'org.jetbrains.kotlin:kotlin-stdlib-jdk8:1.9.23' + implementation 'org.jetbrains.kotlinx:kotlinx-coroutines-android:1.8.0' implementation "com.squareup.okhttp3:okhttp:5.0.0-alpha.10" implementation 'com.neovisionaries:nv-websocket-client:2.14' @@ -348,9 +337,6 @@ dependencies { implementation 'com.google.android.gms:play-services-mlkit-subject-segmentation:16.0.0-beta1' - compileOnly 'org.yaml:snakeyaml:1.29' - implementation 'org.yaml:snakeyaml:1.29' - implementation project(":openpgp-api") compileOnly fileTree("libs") @@ -360,10 +346,8 @@ dependencies { compileOnly "com.google.android.play:core:$playCoreVersion" implementation 'com.google.android.gms:play-services-vision:20.1.3' - debugImplementation 'com.google.android.gms:play-services-maps:18.1.0' - debugImplementation 'com.google.android.gms:play-services-location:20.0.0' - releaseImplementation 'com.google.android.gms:play-services-maps:18.1.0' - releaseImplementation 'com.google.android.gms:play-services-location:20.0.0' + implementation 'com.google.android.gms:play-services-maps:18.2.0' + implementation 'com.google.android.gms:play-services-location:21.2.0' debugImplementation "com.google.firebase:firebase-messaging:$fcmVersion" debugImplementation "com.google.firebase:firebase-crashlytics:$crashlyticsVersion" @@ -383,11 +367,11 @@ dependencies { // add for undo and redo implementation 'org.lsposed.hiddenapibypass:hiddenapibypass:4.3' // add splash screen - implementation("androidx.core:core-splashscreen:1.0.0-beta02") + implementation("androidx.core:core-splashscreen:1.0.1") // add for music tag flac... implementation 'org:jaudiotagger:2.0.3' // add for auto translate - implementation 'com.google.mlkit:language-id:17.0.4' + implementation 'com.google.mlkit:language-id:17.0.5' // add for emoji implementation 'com.jaredrummler:truetypeparser-light:1.0.0' } @@ -416,8 +400,11 @@ android { lint { disable 'MissingTranslation', 'ExtraTranslation', 'BlockedPrivateApi' } + buildFeatures { + buildConfig true + } - tasks.all { task -> + tasks.configureEach { task -> if (task.name.startsWith("uploadCrashlyticsMappingFile")) { task.enabled = false } else if (task.name.contains("Crashlytics") && task.name.contains("NoGcm")) { @@ -426,5 +413,4 @@ android { task.enabled = false } } - } diff --git a/TMessagesProj/proguard-rules.pro b/TMessagesProj/proguard-rules.pro index ac99c70df1..794697f3d1 100644 --- a/TMessagesProj/proguard-rules.pro +++ b/TMessagesProj/proguard-rules.pro @@ -152,3 +152,11 @@ -dontwarn org.osmdroid.** -keepattributes SourceFile,LineNumberTable + +-dontwarn java.beans.** +-dontwarn java.lang.management.** +-dontwarn javax.swing.** +-dontwarn lombok.** +-dontwarn org.slf4j.** +-dontwarn org.w3c.dom.bootstrap.** +-dontwarn sun.net.spi.nameservice.** diff --git a/build.gradle b/build.gradle index fcf4f05e42..980ce080c8 100644 --- a/build.gradle +++ b/build.gradle @@ -6,10 +6,10 @@ buildscript { maven { url "https://plugins.gradle.org/m2/" } } dependencies { - classpath 'com.android.tools.build:gradle:7.3.1' - classpath 'org.jetbrains.kotlin:kotlin-gradle-plugin:1.6.21' - classpath 'com.google.gms:google-services:4.3.14' - classpath 'com.google.firebase:firebase-crashlytics-gradle:2.9.2' + classpath 'com.android.tools.build:gradle:8.2.1' + classpath 'org.jetbrains.kotlin:kotlin-gradle-plugin:1.9.23' + classpath 'com.google.gms:google-services:4.4.1' + classpath 'com.google.firebase:firebase-crashlytics-gradle:2.9.9' classpath 'gradle.plugin.org.mozilla.rust-android-gradle:plugin:0.9.0' //noinspection GradleDependency classpath "com.github.triplet.gradle:play-publisher:3.6.0" diff --git a/gradle.properties b/gradle.properties index f3157e54bf..37277bc7f5 100644 --- a/gradle.properties +++ b/gradle.properties @@ -21,3 +21,5 @@ org.gradle.parallel=true org.gradle.configureondemand=false android.useAndroidX=true android.enableJetifier=true +android.nonTransitiveRClass=false +android.nonFinalResIds=false diff --git a/gradle/wrapper/gradle-wrapper.properties b/gradle/wrapper/gradle-wrapper.properties index 47825044a4..c583a70247 100644 --- a/gradle/wrapper/gradle-wrapper.properties +++ b/gradle/wrapper/gradle-wrapper.properties @@ -1,6 +1,6 @@ #Wed Aug 17 16:55:16 CST 2022 distributionBase=GRADLE_USER_HOME -distributionUrl=https\://services.gradle.org/distributions/gradle-7.5.1-bin.zip +distributionUrl=https\://services.gradle.org/distributions/gradle-8.2-bin.zip distributionPath=wrapper/dists zipStorePath=wrapper/dists zipStoreBase=GRADLE_USER_HOME diff --git a/openpgp-api/build.gradle b/openpgp-api/build.gradle index f389935ee3..54d4444f60 100644 --- a/openpgp-api/build.gradle +++ b/openpgp-api/build.gradle @@ -1,17 +1,20 @@ apply plugin: 'com.android.library' android { - compileSdkVersion 31 + compileSdk 33 defaultConfig { // API-Version . minor minSdkVersion 19 - targetSdkVersion 31 + targetSdkVersion 33 } - buildToolsVersion '31.0.0' + buildToolsVersion '33.0.1' lint { abortOnError false } namespace 'org.openintents.openpgp' + buildFeatures { + aidl true + } } \ No newline at end of file