Skip to content

Commit

Permalink
Telegram v10.2.6, Cherrygram ver. 7.9.2
Browse files Browse the repository at this point in the history
πŸ‡ΊπŸ‡Έ Changelog:
β€” Update to Telegram v10.2.6,
β€” Translate selected text in any message,
β€” Allow to copy photos in chats,
β€” Allow to boost channels faster,
β€” Removed Microsoft App Center Analytics,
β€” Bug fixes and improvements.

πŸ‡·πŸ‡Ί Бписок ΠΈΠ·ΠΌΠ΅Π½Π΅Π½ΠΈΠΉ:
β€” ОбновлСниС Π΄ΠΎ Telegram v10.2.6,
β€” ΠŸΠ΅Ρ€Π΅Π²ΠΎΠ΄ любого Π²Ρ‹Π΄Π΅Π»Π΅Π½Π½ΠΎΠ³ΠΎ Π² сообщСнии тСкста,
β€” Π’ΠΎΠ·ΠΌΠΎΠΆΠ½ΠΎΡΡ‚ΡŒ ΠΊΠΎΠΏΠΈΡ€ΠΎΠ²Π°Ρ‚ΡŒ Ρ„ΠΎΡ‚ΠΎΠ³Ρ€Π°Ρ„ΠΈΠΈ Π² Ρ‡Π°Ρ‚Π°Ρ…,
β€” Π’ΠΎΠ·ΠΌΠΎΠΆΠ½ΠΎΡΡ‚ΡŒ Π±ΡƒΡΡ‚ΠΈΡ‚ΡŒ ΠΊΠ°Π½Π°Π»Ρ‹ ΠΈΠ· профиля,
β€” Π£Π΄Π°Π»Π΅Π½Π° Π°Π½Π°Π»ΠΈΡ‚ΠΈΠΊΠ° Microsoft App Center,
β€” Π˜ΡΠΏΡ€Π°Π²Π»Π΅Π½ΠΈΡ Π±Π°Π³ΠΎΠ² ΠΈ ΡƒΠ»ΡƒΡ‡ΡˆΠ΅Π½ΠΈΡ.
  • Loading branch information
arsLan4k1390 committed Nov 8, 2023
1 parent 777c64f commit 4ad6d99
Show file tree
Hide file tree
Showing 157 changed files with 3,330 additions and 2,117 deletions.
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,7 @@ Join the [Cherrygram official group](https://t.me/CherrygramSupport)
- Jump to the beginning of any chat,
- Delete all OWN messages from groups,
- "Remove file from cache" feature for files in chat,
- Copying photos to clipboard,
- Stickers downloader,
- Messages history from any user and channel in any chat,
- Select messages in chat between message A and message B,
Expand Down
19 changes: 4 additions & 15 deletions TMessagesProj/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ configurations {
compile.exclude module: 'support-v4'
}

configurations.all {
configurations.configureEach {
exclude group: 'com.google.firebase', module: 'firebase-core'
exclude group: 'androidx.recyclerview', module: 'recyclerview'
}
Expand All @@ -25,7 +25,7 @@ def getGitHash = { ->
}

dependencies {
implementation 'androidx.fragment:fragment-ktx:1.6.1'
implementation 'androidx.fragment:fragment-ktx:1.6.2'
implementation 'androidx.core:core-ktx:1.12.0'
implementation 'androidx.palette:palette-ktx:1.0.0'
implementation 'androidx.exifinterface:exifinterface:1.3.6'
Expand Down Expand Up @@ -75,11 +75,6 @@ dependencies {
implementation "androidx.camera:camera-video:${camerax_version}"
implementation 'androidx.interpolator:interpolator:1.0.0'

// Microsoft Analytics
def appCenterSdkVersion = '5.0.2'
implementation "com.microsoft.appcenter:appcenter-analytics:${appCenterSdkVersion}"
implementation "com.microsoft.appcenter:appcenter-crashes:${appCenterSdkVersion}"

coreLibraryDesugaring 'com.android.tools:desugar_jdk_libs:1.1.5'
}

Expand All @@ -92,8 +87,8 @@ android {
viewBinding true
}

compileSdkVersion 34
buildToolsVersion '34.0.0'
compileSdk 34
buildToolsVersion = '34.0.0'
ndkVersion "21.4.7075529"

sourceSets.main.jniLibs.srcDirs = ['./jni/']
Expand Down Expand Up @@ -159,9 +154,6 @@ android {
ndk.debugSymbolLevel = 'FULL'
buildConfigField "boolean", "DEBUG_VERSION", "true"
buildConfigField "boolean", "DEBUG_PRIVATE_VERSION", "false"
buildConfigField("long", "VERSION_CODE", "${APP_VERSION_CODE}")
buildConfigField("String","VERSION_NAME","\"${APP_VERSION_NAME}\"")
buildConfigField("String","VERSION_NAME_CHERRY","\"${APP_VERSION_CHERRY}\"")
}

release {
Expand All @@ -173,9 +165,6 @@ android {
ndk.debugSymbolLevel = 'FULL'
buildConfigField "boolean", "DEBUG_VERSION", "false"
buildConfigField "boolean", "DEBUG_PRIVATE_VERSION", "false"
buildConfigField("long", "VERSION_CODE", "${APP_VERSION_CODE}")
buildConfigField("String","VERSION_NAME","\"${APP_VERSION_NAME}\"")
buildConfigField("String","VERSION_NAME_CHERRY","\"${APP_VERSION_CHERRY}\"")
}
}

Expand Down
2 changes: 1 addition & 1 deletion TMessagesProj/jni/tgnet/ConnectionsManager.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1260,7 +1260,7 @@ void ConnectionsManager::processServerResponse(TLObject *message, int64_t messag
if (!request->respondsToMessageId(resultMid)) {
continue;
}
if (LOGS_ENABLED) DEBUG_D("got response for request %p - %s", request->rawRequest, typeid(*request->rawRequest).name());
if (LOGS_ENABLED) DEBUG_D("got response for request %p - %s (messageId = 0x%" PRIx64 ")", request->rawRequest, typeid(*request->rawRequest).name(), request->messageId);
bool discardResponse = false;
bool isError = false;
bool allowInitConnection = true;
Expand Down
7 changes: 0 additions & 7 deletions TMessagesProj/proguard-rules.pro
Original file line number Diff line number Diff line change
Expand Up @@ -99,13 +99,6 @@
-keep class com.huawei.updatesdk.**{ *; }
-keep class com.huawei.hms.**{ *; }

-keepclassmembernames class com.microsoft.appcenter.AppCenter {
private com.microsoft.appcenter.channel.Channel mChannel;
private android.os.Handler mHandler;
}
-keepclassmembers class * implements com.microsoft.appcenter.AppCenterService {
public static ** getInstance();
}
-keep class com.fasterxml.jackson.**{ *; }

-keep class org.telegram.messenger.voip.* { *; }
Expand Down
9 changes: 8 additions & 1 deletion TMessagesProj/src/main/assets/darkblue.attheme
Original file line number Diff line number Diff line change
Expand Up @@ -429,4 +429,11 @@ chat_searchPanelText=-8796932
chat_inContactIcon=-1
code_comment=-2130706433
chat_outCodeBackground=857487708
chat_inCodeBackground=856033549
chat_inCodeBackground=856033549
code_keyword=-27776
code_constant=-27776
code_function=-27776
code_string=-7806088
code_operator=2147483647
code_number=-10887465
code_comment=2147483647
Binary file modified TMessagesProj/src/main/assets/fonts/rmono.ttf
Binary file not shown.
7 changes: 0 additions & 7 deletions TMessagesProj/src/main/assets/monet_dark.attheme
Original file line number Diff line number Diff line change
Expand Up @@ -47,13 +47,6 @@ avatar_background2Pink=n2_800
avatar_background2Red=n2_800
avatar_background2Saved=n2_800
avatar_background2Violet=n2_800
avatar_nameInMessageBlue=a1_400
avatar_nameInMessageCyan=a1_400
avatar_nameInMessageGreen=a1_400
avatar_nameInMessageOrange=a1_400
avatar_nameInMessagePink=a1_400
avatar_nameInMessageRed=a1_400
avatar_nameInMessageViolet=a1_400
avatar_subtitleInProfileBlue=n1_50
avatar_text=a1_100
calls_callReceivedGreenIcon=monetGreenCall
Expand Down
7 changes: 0 additions & 7 deletions TMessagesProj/src/main/assets/monet_light.attheme
Original file line number Diff line number Diff line change
Expand Up @@ -47,13 +47,6 @@ avatar_background2Pink=a1_600
avatar_background2Red=a1_600
avatar_background2Saved=a1_600
avatar_background2Violet=a1_600
avatar_nameInMessageBlue=a1_400
avatar_nameInMessageCyan=a1_400
avatar_nameInMessageGreen=a1_400
avatar_nameInMessageOrange=a1_400
avatar_nameInMessagePink=a1_400
avatar_nameInMessageRed=a1_400
avatar_nameInMessageViolet=a1_400
avatar_subtitleInProfileBlue=a1_1000
avatar_text=n1_50
calls_callReceivedGreenIcon=monetGreenCall
Expand Down
9 changes: 8 additions & 1 deletion TMessagesProj/src/main/assets/night.attheme
Original file line number Diff line number Diff line change
Expand Up @@ -454,4 +454,11 @@ chat_searchPanelText=-10767620
chat_inContactIcon=-1
code_comment=-2130706433
chat_outCodeBackground=859062986
chat_inCodeBackground=855638016
chat_inCodeBackground=855638016
code_keyword=-27776
code_constant=-27776
code_function=-27776
code_string=-7806088
code_operator=2147483647
code_number=-10887465
code_comment=2147483647
Original file line number Diff line number Diff line change
Expand Up @@ -203,7 +203,7 @@
import java.util.regex.Pattern;

import uz.unnarsx.cherrygram.CherrygramConfig;
import uz.unnarsx.cherrygram.helpers.FontHelper;
import uz.unnarsx.cherrygram.helpers.ui.FontHelper;
import uz.unnarsx.cherrygram.utils.PermissionsUtils;

public class AndroidUtilities {
Expand Down Expand Up @@ -520,6 +520,35 @@ public void updateDrawState(TextPaint textPaint) {
return spannableStringBuilder;
}

public static SpannableStringBuilder replaceSingleLink(String str, int color) {
int startIndex = str.indexOf("**");
int endIndex = str.indexOf("**", startIndex + 1);
str = str.replace("**", "");
int index = -1;
int len = 0;
if (startIndex >= 0 && endIndex >= 0 && endIndex - startIndex > 2) {
len = endIndex - startIndex - 2;
index = startIndex;
}
SpannableStringBuilder spannableStringBuilder = new SpannableStringBuilder(str);
if (index >= 0) {
spannableStringBuilder.setSpan(new ClickableSpan() {
@Override
public void updateDrawState(@NonNull TextPaint ds) {
super.updateDrawState(ds);
ds.setUnderlineText(false);
ds.setColor(color);
}

@Override
public void onClick(@NonNull View view) {

}
}, index, index + len, 0);
}
return spannableStringBuilder;
}

public static void recycleBitmaps(List<Bitmap> bitmapToRecycle) {
if (Build.VERSION.SDK_INT <= 23) {
// cause to crash:
Expand Down Expand Up @@ -2986,6 +3015,9 @@ public static void shakeViewSpring(View view, Runnable endCallback) {
}

public static void shakeViewSpring(View view, float shiftDp, Runnable endCallback) {
if (view == null) {
return;
}
int shift = dp(shiftDp);
if (view.getTag(R.id.spring_tag) != null) {
((SpringAnimation) view.getTag(R.id.spring_tag)).cancel();
Expand Down Expand Up @@ -5590,4 +5622,18 @@ public static void checkAndroidTheme(Context context, boolean open) {
}
context.setTheme(Theme.isCurrentThemeDark() && open ? R.style.Theme_TMessages_Dark : R.style.Theme_TMessages);
}

private static Boolean isHonor;
public static boolean isHonor() {
if (isHonor == null) {
try {
final String brand = Build.BRAND.toLowerCase();
isHonor = brand.contains("huawei") || brand.contains("honor");
} catch (Exception e) {
FileLog.e(e);
isHonor = false;
}
}
return isHonor;
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,6 @@

import uz.unnarsx.cherrygram.CherrygramConfig;
import uz.unnarsx.cherrygram.camera.CameraXUtils;
import uz.unnarsx.cherrygram.helpers.AnalyticsHelper;

public class ApplicationLoader extends Application {

Expand Down Expand Up @@ -264,11 +263,6 @@ public void onCreate() {

}

if (CherrygramConfig.INSTANCE.getAppcenterAnalytics()) {
AnalyticsHelper.start(this);
AnalyticsHelper.trackEvent("App start");
}

super.onCreate();

if (BuildVars.LOGS_ENABLED) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -92,13 +92,20 @@ public String formatCurrency(long amount, String currency) {
}

public String formatCurrency(long amount, String currency, int exp) {
return formatCurrency(amount, currency, exp, false);
}

public String formatCurrency(long amount, String currency, int exp, boolean rounded) {
if (currency.isEmpty()) {
return String.valueOf(amount);
}
Currency cur = Currency.getInstance(currency);
if (cur != null) {
NumberFormat numberFormat = NumberFormat.getCurrencyInstance();
numberFormat.setCurrency(cur);
if (rounded) {
return numberFormat.format(Math.round(amount / Math.pow(10, exp)));
}
return numberFormat.format(amount / Math.pow(10, exp));
}
return amount + " " + currency;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,8 +26,8 @@ public class BuildVars {
public static boolean USE_CLOUD_STRINGS = true;
public static boolean CHECK_UPDATES = false;
public static boolean NO_SCOPED_STORAGE = Build.VERSION.SDK_INT <= 29;
public static int BUILD_VERSION = 4071;
public static String BUILD_VERSION_STRING = "10.2.2";
public static int BUILD_VERSION = 4082;
public static String BUILD_VERSION_STRING = "10.2.6";
public static int APP_ID = 4;
public static String APP_HASH = "014b35b6184100b085b0d0572f9b5103";

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -144,7 +144,7 @@ public void loadReactionsForMessages(long dialogId, ArrayList<MessageObject> vis
});
reactionsRequests.add(reqId);
if (reactionsRequests.size() > 5) {
chatActivity.getConnectionsManager().cancelRequest(reactionsRequests.remove(0), false);
chatActivity.getConnectionsManager().cancelRequest(reactionsRequests.remove(0), true);
}
}

Expand Down
Original file line number Diff line number Diff line change
@@ -1,9 +1,13 @@
package org.telegram.messenger;

import static org.telegram.messenger.AndroidUtilities.dp;

import android.content.Context;
import android.graphics.Canvas;
import android.graphics.Paint;
import android.graphics.Typeface;
import android.text.Editable;
import android.text.Layout;
import android.text.Spannable;
import android.text.SpannableString;
import android.text.SpannableStringBuilder;
Expand All @@ -12,6 +16,7 @@
import android.text.TextPaint;
import android.text.TextUtils;
import android.text.style.CharacterStyle;
import android.text.style.LeadingMarginSpan;
import android.text.style.LineHeightSpan;
import android.text.style.MetricAffectingSpan;
import android.util.Log;
Expand Down Expand Up @@ -52,7 +57,13 @@ public class CodeHighlighting {
public static final int MATCH_COMMENT = 6;
public static final int MATCH_FUNCTION = 7;

public static class Span extends MetricAffectingSpan {
public static int getTextSizeDecrement(int codeLength) {
if (codeLength > 120) return 5;
if (codeLength > 50) return 3;
return 2;
}

public static class Span extends CharacterStyle {

public final String lng;
public final String code;
Expand All @@ -67,36 +78,15 @@ public Span(boolean smallerSize, int type, TextStyleSpan.TextStyleRun style, Str

this.lng = lng;
this.code = code;
if (code == null) {
this.decrementSize = 2;
} else if (code.length() > 120) {
this.decrementSize = 5;
} else if (code.length() > 50) {
this.decrementSize = 3;
} else {
this.decrementSize = 2;
}
this.decrementSize = getTextSizeDecrement(code == null ? 0 : code.length());
this.currentType = type;
this.style = style;
}

@Override
public void updateMeasureState(TextPaint p) {
if (smallerSize) {
p.setTextSize(AndroidUtilities.dp(SharedConfig.fontSize - decrementSize));
}
p.setFlags(p.getFlags() | Paint.SUBPIXEL_TEXT_FLAG);
if (style != null) {
style.applyStyle(p);
} else {
p.setTypeface(Typeface.MONOSPACE);
}
}

@Override
public void updateDrawState(TextPaint p) {
if (smallerSize) {
p.setTextSize(AndroidUtilities.dp(SharedConfig.fontSize - decrementSize));
p.setTextSize(dp(SharedConfig.fontSize - decrementSize));
}
if (currentType == 2) {
p.setColor(0xffffffff);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1384,6 +1384,14 @@ public static int migrate(MessagesStorage messagesStorage, int version) throws E
version = 135;
}

if (version == 135) {
// database.executeFast("DROP TABLE stickersets").stepThis().dispose();
database.executeFast("CREATE TABLE stickersets2(id INTEGER PRIMATE KEY, data BLOB, hash INTEGER, date INTEGER);").stepThis().dispose();
database.executeFast("CREATE INDEX IF NOT EXISTS stickersets2_id_index ON stickersets2(id);").stepThis().dispose();
database.executeFast("PRAGMA user_version = 136").stepThis().dispose();
version = 136;
}

return version;
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,7 @@ public interface FileDownloadProgressListener {
public final SparseArray<MessageObject> unviewedDownloads = new SparseArray<>();

public static class Preset {
public int[] mask = new int[5];
public int[] mask = new int[4];
public long[] sizes = new long[4];
public boolean preloadVideo;
public boolean preloadMusic;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@
import java.util.Locale;

import uz.unnarsx.cherrygram.CherrygramConfig;
import uz.unnarsx.cherrygram.helpers.FontHelper;
import uz.unnarsx.cherrygram.helpers.ui.FontHelper;

public class Emoji {

Expand Down
Loading

0 comments on commit 4ad6d99

Please sign in to comment.