diff --git a/TMessagesProj/build.gradle b/TMessagesProj/build.gradle index 5176e742a97..b1bf325a9c0 100644 --- a/TMessagesProj/build.gradle +++ b/TMessagesProj/build.gradle @@ -1,14 +1,13 @@ import org.gradle.nativeplatform.platform.internal.DefaultNativePlatform - -apply plugin: 'com.android.library' - -repositories { - mavenCentral() - google() +import org.gradle.internal.os.OperatingSystem +import java.nio.file.Paths +plugins { + id 'com.android.library' + id 'com.google.gms.google-services' } configurations { - compile.exclude module: 'support-v4' +compile.exclude module: 'support-v4' } configurations.all { @@ -29,16 +28,17 @@ dependencies { compileOnly 'org.checkerframework:checker-qual:2.5.2' compileOnly 'org.checkerframework:checker-compat-qual:2.5.0' - implementation 'com.google.firebase:firebase-messaging:22.0.0' - implementation 'com.google.firebase:firebase-config:21.0.1' - implementation 'com.google.firebase:firebase-datatransport:18.1.0' + implementation 'com.google.firebase:firebase-messaging:23.2.0' + implementation 'com.google.firebase:firebase-config:21.4.1' + implementation 'com.google.firebase:firebase-datatransport:18.1.8' implementation 'com.google.firebase:firebase-appindexing:20.0.0' implementation 'com.google.android.gms:play-services-maps:18.1.0' - implementation 'com.google.android.gms:play-services-auth:20.4.0' + implementation 'com.google.android.gms:play-services-auth:20.6.0' implementation 'com.google.android.gms:play-services-vision:20.1.3' implementation 'com.google.android.gms:play-services-wearable:18.0.0' implementation 'com.google.android.gms:play-services-location:21.0.1' - implementation 'com.google.android.gms:play-services-wallet:19.1.0' + implementation 'com.google.android.gms:play-services-wallet:19.2.0' + implementation 'com.google.android.gms:play-services-safetynet:18.0.1' implementation 'com.googlecode.mp4parser:isoparser:1.0.6' implementation 'com.stripe:stripe-android:2.0.2' implementation 'com.google.mlkit:language-id:16.1.1' @@ -64,15 +64,21 @@ dependencies { def isWindows = String.valueOf(DefaultNativePlatform.currentOperatingSystem.toFamilyName() == OperatingSystemFamily.WINDOWS) android { +<<<<<<< HEAD compileSdkVersion 34 buildToolsVersion '34.0.0' +======= + namespace 'org.telegram.messenger' + compileSdkVersion 33 + buildToolsVersion '33.0.0' +>>>>>>> b27b9ff56 (updated gradle) ndkVersion "21.4.7075529" sourceSets.main.jniLibs.srcDirs = ['./jni/'] externalNativeBuild { cmake { - path 'jni/CMakeLists.txt' + path 'jni/CMakeLists.txt' } } @@ -87,14 +93,15 @@ android { } compileOptions { - sourceCompatibility JavaVersion.VERSION_1_8 - targetCompatibility JavaVersion.VERSION_1_8 + sourceCompatibility JavaVersion.VERSION_17 + targetCompatibility JavaVersion.VERSION_17 coreLibraryDesugaringEnabled true } defaultConfig { + defaultConfig.versionCode Integer.parseInt(APP_VERSION_CODE) minSdkVersion 19 targetSdkVersion 34 @@ -106,10 +113,20 @@ android { cmake { version '3.10.2' arguments '-DANDROID_STL=c++_static', '-DANDROID_PLATFORM=android-16' +<<<<<<< HEAD +======= + System.getenv("PATH").split(File.pathSeparator).any { path -> + var file = Paths.get("${path}${File.separator}ccache${if (OperatingSystem.current().windows) ".exe" else ""}").toFile() + if (file.exists()) { + println("Using ccache ${file.getAbsolutePath()}") + arguments += "-DANDROID_CCACHE=${file.getAbsolutePath()}" + return true + } + } +>>>>>>> b27b9ff56 (updated gradle) } } } - buildTypes { debug { jniDebuggable true @@ -179,7 +196,7 @@ android { release { jniDebuggable false - minifyEnabled true + minifyEnabled false shrinkResources false multiDexEnabled true proguardFiles getDefaultProguardFile('proguard-android.txt'), '../TMessagesProj/proguard-rules.pro' @@ -189,6 +206,7 @@ android { buildConfigField "boolean", "DEBUG_VERSION", "false" buildConfigField "boolean", "DEBUG_PRIVATE_VERSION", "false" buildConfigField "boolean", "BUILD_HOST_IS_WINDOWS", isWindows + signingConfig signingConfigs.debug } } namespace 'org.telegram.messenger' @@ -204,6 +222,7 @@ def getProps(String propName) { } else { return ""; } +<<<<<<< HEAD } apply plugin: 'com.google.gms.google-services' @@ -227,4 +246,7 @@ task checkVisibility { } } -preBuild.dependsOn checkVisibility \ No newline at end of file +preBuild.dependsOn checkVisibility +======= +} +>>>>>>> b27b9ff56 (updated gradle) diff --git a/TMessagesProj/src/main/java/org/telegram/ui/Cells/ChatMessageCell.java b/TMessagesProj/src/main/java/org/telegram/ui/Cells/ChatMessageCell.java index 2c5ab2ee764..6f33684911d 100644 --- a/TMessagesProj/src/main/java/org/telegram/ui/Cells/ChatMessageCell.java +++ b/TMessagesProj/src/main/java/org/telegram/ui/Cells/ChatMessageCell.java @@ -22926,7 +22926,9 @@ public SeekBar getSeekBar() { public SeekBarWaveform getSeekBarWaveform() { return seekBarWaveform; } - + private boolean canAddOrUseProfileNode() { + return isChat && !currentMessageObject.isOut() &&(currentUser !=null ||currentChat!=null &¤tMessageObject.isFromGroup()); + } private class MessageAccessibilityNodeProvider extends AccessibilityNodeProvider { public static final int PROFILE = 5000; @@ -22950,17 +22952,18 @@ private class MessageAccessibilityNodeProvider extends AccessibilityNodeProvider private Rect rect = new Rect(); private class ProfileSpan extends ClickableSpan { - private TLRPC.User user; - - public ProfileSpan(TLRPC.User user) { - this.user = user; - } - + private Object profile; + public ProfileSpan(Object profile) { + this.profile = profile; + } @Override public void onClick(@NonNull View view) { - if (delegate != null) { - delegate.didPressUserAvatar(ChatMessageCell.this, user, 0, 0, false); +if (delegate != null) { + if(profile instanceof TLRPC.User) { + if(((TLRPC.User) profile).id !=0) delegate.didPressUserAvatar(ChatMessageCell.this, (TLRPC.User) profile, 0, 0,false); else delegate.didPressHiddenForward(ChatMessageCell.this); } + else delegate.didPressChannelAvatar(ChatMessageCell.this,(TLRPC.Chat) profile,0,0,0,false); + } } } @@ -22976,11 +22979,19 @@ public AccessibilityNodeInfo createAccessibilityNodeInfo(int virtualViewId) { final long fileSize = currentMessageObject != null ? currentMessageObject.loadedFileSize : 0; if (accessibilityText == null || accessibilityTextUnread != unread || accessibilityTextContentUnread != contentUnread || accessibilityTextFileSize != fileSize) { SpannableStringBuilder sb = new SpannableStringBuilder(); - if (isChat && currentUser != null && !currentMessageObject.isOut()) { - sb.append(UserObject.getUserName(currentUser)); - sb.setSpan(new ProfileSpan(currentUser), 0, sb.length(), Spanned.SPAN_EXCLUSIVE_EXCLUSIVE); + if (isChat && !currentMessageObject.isOut()) { + if(currentUser !=null) { + sb.append(UserObject.getUserName(currentUser)); + sb.setSpan(new ProfileSpan(currentUser), 0, sb.length(), Spanned.SPAN_EXCLUSIVE_EXCLUSIVE); + } + else if(currentChat !=null &¤tMessageObject.isFromGroup()) { + sb.append(currentChat.title); + sb.setSpan(new ProfileSpan(currentChat), 0, sb.length(), Spanned.SPAN_EXCLUSIVE_EXCLUSIVE); + } sb.append('\n'); } + //add information,if something write from channel,but not from user name (it can do,for example,channel creators). + else if(currentUser ==null && currentMessageObject.customName !=null &¤tMessageObject.customName.length()>0) sb.append(currentMessageObject.customName+"\n"); if (drawForwardedName) { for (int a = 0; a < 2; a++) { if (forwardedNameLayout[a] != null && forwardedNameLayout[a].getText() != null) { @@ -23054,14 +23065,14 @@ public AccessibilityNodeInfo createAccessibilityNodeInfo(int virtualViewId) { sb.append(AndroidUtilities.formatFileSize(documentAttach.size)); } } + //even if we switch on voice transcription,we should announce caption too. + if (currentMessageObject.messageOwner.media != null && !TextUtils.isEmpty(currentMessageObject.caption)) { + sb.append("\n"); + sb.append(currentMessageObject.caption); + } if (currentMessageObject.isVoiceTranscriptionOpen()) { sb.append("\n"); sb.append(currentMessageObject.getVoiceTranscription()); - } else { - if (MessageObject.getMedia(currentMessageObject.messageOwner) != null && !TextUtils.isEmpty(currentMessageObject.caption)) { - sb.append("\n"); - sb.append(currentMessageObject.caption); - } } if (currentMessageObject.isOut()) { if (currentMessageObject.isSent()) { @@ -23084,10 +23095,14 @@ public AccessibilityNodeInfo createAccessibilityNodeInfo(int virtualViewId) { sb.append("\n"); sb.append(getString("AccDescrMsgSendingError", R.string.AccDescrMsgSendingError)); } - } else { + } else if(currentTimeString.length()>0) { sb.append("\n"); sb.append(LocaleController.formatString("AccDescrReceivedDate", R.string.AccDescrReceivedDate, getString("TodayAt", R.string.TodayAt) + " " + currentTimeString)); } + if(currentMessageObject.isSponsored()) { + sb.append("\n"); + sb.append(LocaleController.getString("SponsoredMessage",R.string.SponsoredMessage)); + } if (getRepliesCount() > 0 && !hasCommentLayout()) { sb.append("\n"); sb.append(LocaleController.formatPluralString("AccDescrNumberOfReplies", getRepliesCount())); @@ -23225,7 +23240,7 @@ public void onClick(View view) { int i; if (Build.VERSION.SDK_INT < Build.VERSION_CODES.N) { - if (isChat && currentUser != null && !currentMessageObject.isOut()) { + if (canAddOrUseProfileNode()) { info.addChild(ChatMessageCell.this, PROFILE); } if (currentMessageObject.messageText instanceof Spannable) { @@ -23305,10 +23320,10 @@ public void onClick(View view) { info.setParent(ChatMessageCell.this); info.setPackageName(getContext().getPackageName()); if (virtualViewId == PROFILE) { - if (currentUser == null) { + if (!canAddOrUseProfileNode()) { return null; } - String content = UserObject.getUserName(currentUser); + String content = currentUser != null ? UserObject.getUserName(currentUser) : currentChat.title; info.setText(content); rect.set((int) nameX, (int) nameY, (int) (nameX + nameWidth), (int) (nameY + (nameLayout != null ? nameLayout.getHeight() : 10))); info.setBoundsInParent(rect); @@ -23428,11 +23443,11 @@ public void onClick(View view) { } PollButton button = pollButtons.get(buttonIndex); StringBuilder sb = new StringBuilder(button.title.getText()); - if (!pollVoted) { +if(pollVoted ||pollClosed) sb.append(", ").append(button.percent).append("%"); + if (!pollVoted &&!pollClosed) { info.setClassName("android.widget.Button"); - } else { + } else if (pollVoted) { info.setSelected(button.chosen); - sb.append(", ").append(button.percent).append("%"); if (lastPoll != null && lastPoll.quiz && (button.chosen || button.correct)) { sb.append(", ").append(button.correct ? getString("AccDescrQuizCorrectAnswer", R.string.AccDescrQuizCorrectAnswer) : getString("AccDescrQuizIncorrectAnswer", R.string.AccDescrQuizIncorrectAnswer)); } diff --git a/TMessagesProj/src/main/java/org/telegram/ui/LaunchActivity.java b/TMessagesProj/src/main/java/org/telegram/ui/LaunchActivity.java index d5034057caa..68be043cbfc 100644 --- a/TMessagesProj/src/main/java/org/telegram/ui/LaunchActivity.java +++ b/TMessagesProj/src/main/java/org/telegram/ui/LaunchActivity.java @@ -6426,6 +6426,7 @@ protected void onDestroy() { } catch (Exception e) { FileLog.e(e); } + clearFragments(); super.onDestroy(); onFinish(); FloatingDebugController.onDestroy(); diff --git a/TMessagesProj_App/build.gradle b/TMessagesProj_App/build.gradle index e1a5c072ed6..725dbf3101b 100644 --- a/TMessagesProj_App/build.gradle +++ b/TMessagesProj_App/build.gradle @@ -1,10 +1,7 @@ -apply plugin: 'com.android.application' - -repositories { - mavenCentral() - google() +plugins { + id 'com.android.application' + id 'com.google.gms.google-services' } - configurations { compile.exclude module: 'support-v4' } @@ -22,6 +19,7 @@ dependencies { } android { + namespace 'org.telegram.messenger.regular' compileSdkVersion 34 buildToolsVersion '34.0.0' @@ -91,7 +89,7 @@ android { debuggable false jniDebuggable false signingConfig signingConfigs.release - minifyEnabled true + minifyEnabled false shrinkResources false multiDexEnabled true proguardFiles getDefaultProguardFile('proguard-android.txt'), '../TMessagesProj/proguard-rules.pro' @@ -199,5 +197,3 @@ android { checkReleaseBuilds false } } - -apply plugin: 'com.google.gms.google-services' diff --git a/TMessagesProj_AppHockeyApp/build.gradle b/TMessagesProj_AppHockeyApp/build.gradle index b1c7dd7bc3b..5e228c790b2 100644 --- a/TMessagesProj_AppHockeyApp/build.gradle +++ b/TMessagesProj_AppHockeyApp/build.gradle @@ -1,8 +1,6 @@ -apply plugin: 'com.android.application' - -repositories { - mavenCentral() - google() +plugins { + id 'com.android.application' + id 'com.google.gms.google-services' } configurations { @@ -28,6 +26,7 @@ dependencies { } android { + namespace 'org.telegram.messenger.regular' compileSdkVersion 34 buildToolsVersion '34.0.0' @@ -184,5 +183,3 @@ android { checkReleaseBuilds false } } - -apply plugin: 'com.google.gms.google-services' diff --git a/TMessagesProj_AppHuawei/build.gradle b/TMessagesProj_AppHuawei/build.gradle index 8a5393c8a6b..d12658c5240 100644 --- a/TMessagesProj_AppHuawei/build.gradle +++ b/TMessagesProj_AppHuawei/build.gradle @@ -1,10 +1,7 @@ -apply plugin: 'com.android.application' -apply plugin: 'com.huawei.agconnect' - -repositories { - mavenCentral() - google() - maven { url 'https://developer.huawei.com/repo/' } +plugins { + id 'com.android.application' + //id 'com.huawei.agconnect' +id 'com.google.gms.google-services' } configurations { @@ -30,8 +27,10 @@ dependencies { } android { + namespace 'org.telegram.messenger.huawei' compileSdkVersion 34 buildToolsVersion '34.0.0' +>>>>>>> b27b9ff56 (updated gradle) defaultConfig.applicationId = APP_PACKAGE @@ -163,5 +162,3 @@ android { checkReleaseBuilds false } } - -apply plugin: 'com.google.gms.google-services' diff --git a/TMessagesProj_AppStandalone/build.gradle b/TMessagesProj_AppStandalone/build.gradle index 8c1b9b64c8c..43bbabfb1ae 100644 --- a/TMessagesProj_AppStandalone/build.gradle +++ b/TMessagesProj_AppStandalone/build.gradle @@ -1,10 +1,7 @@ -apply plugin: 'com.android.application' - -repositories { - mavenCentral() - google() +plugins { + id 'com.android.application' + id 'com.google.gms.google-services' } - configurations { compile.exclude module: 'support-v4' } @@ -24,6 +21,7 @@ dependencies { } android { + namespace 'org.telegram.messenger.regular' compileSdkVersion 34 buildToolsVersion '34.0.0' diff --git a/build.gradle b/build.gradle index 63bc73b02f1..4104075e2b6 100644 --- a/build.gradle +++ b/build.gradle @@ -11,6 +11,8 @@ buildscript { classpath 'com.huawei.agconnect:agcp:1.9.1.301' } } -repositories { - google() +plugins { + id 'com.android.application' version '8.0.2' apply false + id 'com.google.gms.google-services' version '4.3.15' apply false + id 'com.huawei.agconnect' version '1.9.1.300' apply false } diff --git a/gradle/wrapper/gradle-wrapper.properties b/gradle/wrapper/gradle-wrapper.properties index ee5360fdd7a..0f574dbf9d4 100644 --- a/gradle/wrapper/gradle-wrapper.properties +++ b/gradle/wrapper/gradle-wrapper.properties @@ -1,6 +1,6 @@ -#Mon Oct 19 01:57:36 MSK 2020 +#Sat Jul 29 20:41:11 MSK 2023 distributionBase=GRADLE_USER_HOME distributionPath=wrapper/dists +distributionUrl=https\://services.gradle.org/distributions/gradle-8.2.1-bin.zip zipStoreBase=GRADLE_USER_HOME zipStorePath=wrapper/dists -distributionUrl=https\://services.gradle.org/distributions/gradle-7.0.2-bin.zip diff --git a/settings.gradle b/settings.gradle index dd7a48e7c9c..85e44309258 100644 --- a/settings.gradle +++ b/settings.gradle @@ -1,3 +1,23 @@ +pluginManagement { + repositories { + gradlePluginPortal() + google() + mavenCentral() + maven { + url 'https://developer.huawei.com/repo/' + } + } +} +dependencyResolutionManagement { + repositoriesMode.set(RepositoriesMode.FAIL_ON_PROJECT_REPOS) + repositories { + google() + mavenCentral() + maven { + url 'https://developer.huawei.com/repo/' + } + } +} include ':TMessagesProj' include ':TMessagesProj_App' include ':TMessagesProj_AppHuawei'