Skip to content

Commit

Permalink
upstream: bump version to v10.14.5
Browse files Browse the repository at this point in the history
Signed-off-by: qwq233 <qwq233@qwq2333.top>
  • Loading branch information
qwq233 committed Jul 11, 2024
2 parents 5494d95 + 5fa5549 commit 68edb16
Show file tree
Hide file tree
Showing 31 changed files with 242 additions and 125 deletions.
2 changes: 1 addition & 1 deletion TMessagesProj/jni/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@ add_library(libvpx STATIC IMPORTED)
set_target_properties(libvpx PROPERTIES IMPORTED_LOCATION ${CMAKE_HOME_DIRECTORY}/ffmpeg/${ANDROID_ABI}/libvpx.a)

add_library(rust STATIC IMPORTED)
set_target_properties(rust PROPERTIES IMPORTED_LOCATION ${CMAKE_HOME_DIRECTORY}/integrity/${ANDROID_ABI}/librust.a.12)
set_target_properties(rust PROPERTIES IMPORTED_LOCATION ${CMAKE_HOME_DIRECTORY}/integrity/${ANDROID_ABI}/librust.a.13)

#tgnet
add_library(tgnet STATIC
Expand Down
Binary file not shown.
Binary file not shown.
4 changes: 0 additions & 4 deletions TMessagesProj/jni/integrity/include/rust.h
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,7 @@
// Created by qwq233 on 3/24/2024.
//

//#include <stdbool.h>
//#include <stdarg.h>
//#include <stdbool.h>
#include <cstdint>
//#include <stdlib.h>

extern "C" uint8_t logd(const char *tag, const char *msg);
extern "C" uint8_t logi(const char *tag, const char *msg);
Expand Down
13 changes: 0 additions & 13 deletions TMessagesProj/src/main/AndroidManifest.xml
Original file line number Diff line number Diff line change
Expand Up @@ -122,19 +122,6 @@
<action android:name="android.intent.action.VIEW"/>
<data android:scheme="ton"/>
</intent>

<package android:name="com.android.chrome" />
<package android:name="org.mozilla.firefox" />
<package android:name="com.microsoft.emmx" />
<package android:name="com.opera.browser" />
<package android:name="com.opera.mini.native" />
<package android:name="com.brave.browser" />
<package android:name="com.duckduckgo.mobile.android" />
<package android:name="com.sec.android.app.sbrowser" />
<package android:name="com.vivaldi.browser" />
<package android:name="com.kiwibrowser.browser" />
<package android:name="com.UCMobile.intl" />
<package android:name="org.torproject.torbrowser" />
</queries>

<application
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,6 @@
import android.content.pm.PackageManager;
import android.content.pm.Signature;
import android.content.res.AssetFileDescriptor;
import android.content.res.AssetManager;
import android.content.res.Configuration;
import android.database.Cursor;
import android.graphics.Bitmap;
Expand All @@ -54,10 +53,6 @@
import android.graphics.drawable.BitmapDrawable;
import android.graphics.drawable.ColorDrawable;
import android.graphics.drawable.Drawable;
import android.graphics.fonts.Font;
import android.graphics.fonts.FontFamily;
import android.graphics.fonts.FontStyle;
import android.graphics.fonts.SystemFonts;
import android.net.Uri;
import android.os.Build;
import android.os.Bundle;
Expand Down Expand Up @@ -110,7 +105,6 @@
import android.view.accessibility.AccessibilityEvent;
import android.view.accessibility.AccessibilityManager;
import android.view.animation.AccelerateInterpolator;
import android.view.animation.Animation;
import android.view.animation.DecelerateInterpolator;
import android.view.animation.Interpolator;
import android.view.animation.OvershootInterpolator;
Expand All @@ -131,9 +125,7 @@
import androidx.core.content.ContextCompat;
import androidx.core.content.FileProvider;
import androidx.core.graphics.ColorUtils;
import androidx.core.graphics.TypefaceCompatUtil;
import androidx.core.math.MathUtils;
import androidx.core.provider.FontRequest;
import androidx.core.widget.NestedScrollView;
import androidx.dynamicanimation.animation.DynamicAnimation;
import androidx.dynamicanimation.animation.SpringAnimation;
Expand Down Expand Up @@ -3864,7 +3856,7 @@ public static void openDocument(MessageObject message, Activity activity, BaseFr
}
}

public static boolean openForView(File f, String fileName, String mimeType, final Activity activity, Theme.ResourcesProvider resourcesProvider) {
public static boolean openForView(File f, String fileName, String mimeType, final Activity activity, Theme.ResourcesProvider resourcesProvider, boolean restrict) {
if (f != null && f.exists()) {
String realMimeType = null;
Intent intent = new Intent(Intent.ACTION_VIEW);
Expand All @@ -3873,6 +3865,10 @@ public static boolean openForView(File f, String fileName, String mimeType, fina
int idx = fileName.lastIndexOf('.');
if (idx != -1) {
String ext = fileName.substring(idx + 1);
int h = ext.toLowerCase().hashCode();
if (restrict && (h == 0x17a1c || h == 0x3107ab || h == 0x19a1b || h == 0xe55 || h == 0x18417)) {
return true;
}
realMimeType = myMime.getMimeTypeFromExtension(ext.toLowerCase());
if (realMimeType == null) {
realMimeType = mimeType;
Expand Down Expand Up @@ -3913,7 +3909,7 @@ public static boolean openForView(File f, String fileName, String mimeType, fina
return false;
}

public static boolean openForView(MessageObject message, Activity activity, Theme.ResourcesProvider resourcesProvider) {
public static boolean openForView(MessageObject message, Activity activity, Theme.ResourcesProvider resourcesProvider, boolean restrict) {
File f = null;
if (message.messageOwner.attachPath != null && message.messageOwner.attachPath.length() != 0) {
f = new File(message.messageOwner.attachPath);
Expand All @@ -3922,13 +3918,13 @@ public static boolean openForView(MessageObject message, Activity activity, Them
f = FileLoader.getInstance(message.currentAccount).getPathToMessage(message.messageOwner);
}
String mimeType = message.type == MessageObject.TYPE_FILE || message.type == MessageObject.TYPE_TEXT ? message.getMimeType() : null;
return openForView(f, message.getFileName(), mimeType, activity, resourcesProvider);
return openForView(f, message.getFileName(), mimeType, activity, resourcesProvider, restrict);
}

public static boolean openForView(TLRPC.Document document, boolean forceCache, Activity activity) {
String fileName = FileLoader.getAttachFileName(document);
File f = FileLoader.getInstance(UserConfig.selectedAccount).getPathToAttach(document, true);
return openForView(f, fileName, document.mime_type, activity, null);
return openForView(f, fileName, document.mime_type, activity, null, false);
}

public static SpannableStringBuilder formatSpannableSimple(CharSequence format, CharSequence... cs) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -31,8 +31,8 @@ public class BuildVars {
public static boolean LOGS_ENABLED = true;
public static boolean USE_CLOUD_STRINGS = true;
public static boolean NO_SCOPED_STORAGE = Build.VERSION.SDK_INT <= 29;
public static final int BUILD_VERSION = 4927;
public static final String BUILD_VERSION_STRING = "10.14.3";
public static final int BUILD_VERSION = 4945;
public static final String BUILD_VERSION_STRING = "10.14.5";
public static final int APP_ID = 19797609;
public static final String APP_HASH = "e8f1567dbbf38944a1391c4d23c34b60";
public static final String APPCENTER_HASH = "PLACEHOLDER";
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1546,8 +1546,10 @@ public static String formatPluralStringComma(String key, int plural, char symbol
value = BuildVars.USE_CLOUD_STRINGS ? getInstance().localeValues.get(key + "_other") : null;
}
if (value == null) {
int resourceId = ApplicationLoader.applicationContext.getResources().getIdentifier(param, "string", ApplicationLoader.applicationContext.getPackageName());
value = ApplicationLoader.applicationContext.getString(resourceId);
try {
int resourceId = ApplicationLoader.applicationContext.getResources().getIdentifier(param, "string", ApplicationLoader.applicationContext.getPackageName());
value = ApplicationLoader.applicationContext.getString(resourceId);
} catch (Exception e2) {}
}
if (value == null) {
int resourceId = ApplicationLoader.applicationContext.getResources().getIdentifier(key + "_other", "string", ApplicationLoader.applicationContext.getPackageName());
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8464,6 +8464,7 @@ public static boolean isVideoDocument(TLRPC.Document document) {
}
boolean isAnimated = false;
boolean isVideo = false;
String filename = null;
int width = 0;
int height = 0;
for (int a = 0; a < document.attributes.size(); a++) {
Expand All @@ -8477,6 +8478,20 @@ public static boolean isVideoDocument(TLRPC.Document document) {
height = attribute.h;
} else if (attribute instanceof TLRPC.TL_documentAttributeAnimated) {
isAnimated = true;
} else if (attribute instanceof TLRPC.TL_documentAttributeFilename) {
filename = attribute.file_name;
}
}
if (filename != null) {
int index = filename.lastIndexOf(".");
if (index >= 0) {
String ext = filename.substring(index + 1);
switch (ext.toLowerCase().hashCode()) {
case 0x17a1c: case 0x3107ab: case 0x19a1b:
case 0xe55: case 0x18417: case 0x184fe:
case 0x18181:
return false;
}
}
}
if (isAnimated && (width > 1280 || height > 1280)) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19972,13 +19972,13 @@ public boolean checkCanOpenChat(Bundle bundle, BaseFragment fragment, MessageObj
@Override
public void onMessagesLoaded(boolean fromCache) {
progress.end();
fragment.presentFragment(new ChatActivity(bundle), true);
fragment.presentFragment(new ChatActivity(bundle));
}

@Override
public void onError() {
progress.end();
fragment.presentFragment(new ChatActivity(bundle), true);
fragment.presentFragment(new ChatActivity(bundle));
}
}));
return false;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -60,6 +60,7 @@

import java.lang.ref.WeakReference;
import java.net.URLEncoder;
import java.util.Collections;
import java.util.List;
import java.util.regex.Matcher;

Expand Down Expand Up @@ -264,11 +265,9 @@ public static void openUrl(final Context context, Uri uri, boolean _allowCustom,
boolean[] forceBrowser = new boolean[]{false};
boolean internalUri = isInternalUri(uri, forceBrowser);
String browserPackage = getBrowserPackageName(browser);
if (isBrowserPackageInstalled(context, browserPackage, uri)) {
if (browserPackage != null) {
tryTelegraph = false;
_allowCustom = false;
} else {
browserPackage = null;
}
final boolean allowCustom = _allowCustom;
if (tryTelegraph) {
Expand Down Expand Up @@ -442,7 +441,16 @@ public static void openUrl(final Context context, Uri uri, boolean _allowCustom,
intent.putExtra(LaunchActivity.EXTRA_FORCE_NOT_INTERNAL_APPS, forceNotInternalForApps);
((LaunchActivity) context).onNewIntent(intent, inCaseLoading);
} else {
context.startActivity(intent);
try {
context.startActivity(intent);
} catch (Exception e2) {
if (browserPackage != null) {
intent.setPackage(browserPackage = null);
context.startActivity(intent);
} else {
FileLog.e(e2);
}
}
}
} catch (Exception e) {
FileLog.e(e);
Expand Down Expand Up @@ -599,14 +607,6 @@ public static String getBrowserPackageName(String browser) {
return null;
}

public static boolean isBrowserPackageInstalled(Context context, String packageName, Uri uri) {
if (packageName == null) return false;
PackageManager packageManager = context.getPackageManager();
Intent intent = new Intent(Intent.ACTION_VIEW, uri);
intent.setPackage(packageName);
return packageManager.resolveActivity(intent, 0) != null;
}

public static String replaceHostname(Uri originalUri, String newHostname) {
String scheme = originalUri.getScheme();
String userInfo = originalUri.getUserInfo();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -332,7 +332,7 @@ private void openItem(CacheModel.FileInfo fileInfo, CacheCell cacheCell) {
photoEntries.add(new MediaController.PhotoEntry(0, 0, 0, fileInfo.file.getPath(), 0, fileInfo.type == TYPE_VIDEOS, 0, 0, 0));
PhotoViewer.getInstance().openPhotoForSelect(photoEntries, 0, PhotoViewer.SELECT_TYPE_NO_SELECT, false, placeProvider, null);
} else {
AndroidUtilities.openForView(fileInfo.file, fileInfo.file.getName(), null, parentFragment.getParentActivity(), null);
AndroidUtilities.openForView(fileInfo.file, fileInfo.file.getName(), null, parentFragment.getParentActivity(), null, false);
}
}
if (cacheCell.type == TYPE_MUSIC) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19632,7 +19632,7 @@ private void drawCaptionLayout(Canvas canvas, MessageObject.TextLayoutBlocks cap
buttonX -= AndroidUtilities.dp(10);
}
commentButtonRect.set(
buttonX - AndroidUtilities.dp((currentMessageObject == null || !currentMessageObject.isOut()) && !drawPinnedBottom && currentPosition == null && (currentMessageObject == null || currentMessageObject.type != MessageObject.TYPE_POLL || pollInstantViewTouchesBottom) ? 6 : 0),
buttonX - AndroidUtilities.dp((currentMessageObject == null || !currentMessageObject.isOutOwner()) && !drawPinnedBottom && currentPosition == null && (currentMessageObject == null || currentMessageObject.type != MessageObject.TYPE_POLL || pollInstantViewTouchesBottom) ? 6 : 0),
(int) buttonY,
endX - AndroidUtilities.dp(14),
layoutHeight - AndroidUtilities.dp(h) + 1
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3177,7 +3177,7 @@ public void didPressImage(ChatMessageCell cell, float x, float y) {
}
}
try {
AndroidUtilities.openForView(message, getParentActivity(), null);
AndroidUtilities.openForView(message, getParentActivity(), null, false);
} catch (Exception e) {
alertUserOpenError(message);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -313,6 +313,7 @@ public boolean dispatchTouchEvent(MotionEvent event) {
return super.dispatchTouchEvent(event);
}
};
starsBalanceEditTextContainer.setVisibility(GONE);
starsBalanceEditTextContainer.setText(getString(R.string.BotStarsWithdrawPlaceholder));
starsBalanceEditTextContainer.setLeftPadding(dp(14 + 22));
starsBalanceEditText = new EditTextBoldCursor(context) {
Expand Down Expand Up @@ -691,13 +692,14 @@ private void setStarsBalance(long crypto_amount, int blockedUntil) {
starsBalance = crypto_amount;
starsBalanceTitle.setText(ssb);
starsBalanceSubtitle.setText("≈" + BillingController.getInstance().formatCurrency(amount, "USD"));
starsBalanceEditTextContainer.setVisibility(crypto_amount > 0 ? VISIBLE : GONE);
if (starsBalanceEditTextAll) {
starsBalanceEditTextIgnore = true;
starsBalanceEditText.setText(Long.toString(starsBalanceEditTextValue = crypto_amount));
starsBalanceEditText.setSelection(starsBalanceEditText.getText().length());
starsBalanceEditTextIgnore = false;

balanceButton.setEnabled(starsBalanceEditTextValue > 0);
starsBalanceButton.setEnabled(starsBalanceEditTextValue > 0);
}
starsBalanceBlockedUntil = blockedUntil;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1174,8 +1174,10 @@ public long findMinValue(int startXIndex, int endXIndex) {
return minValue;
}

public void setData(T chartData) {
public boolean setData(T chartData) {
boolean updated = false;
if (this.chartData != chartData) {
updated = true;
invalidate();
lines.clear();
if (chartData != null && chartData.lines != null) {
Expand Down Expand Up @@ -1235,6 +1237,7 @@ public void setData(T chartData) {
alphaAnimator.cancel();
}
}
return updated;
}

protected float getMinDistance() {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -233,6 +233,12 @@ public boolean move(int x, int y, int pointer) {
return true;
}

public void set(float start, float end) {
pickerStart = start;
pickerEnd = end;
view.onPickerDataChanged();
}

public boolean uncapture(MotionEvent event, int pointerIndex) {
if (pointerIndex == 0) {
if (tryMoveTo) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -312,13 +312,14 @@ void drawBottomSignature(Canvas canvas) {


@Override
public void setData(StackLinearChartData chartData) {
super.setData(chartData);
public boolean setData(StackLinearChartData chartData) {
boolean u = super.setData(chartData);
if (chartData != null) {
values = new float[chartData.lines.size()];
darawingValuesPercentage = new float[chartData.lines.size()];
onPickerDataChanged(false, true, false);
}
return u;
}

@Override
Expand Down
Loading

0 comments on commit 68edb16

Please sign in to comment.