Skip to content

Commit 9b2ea0f

Browse files
committed
chore: update dependencies
1 parent 60b592b commit 9b2ea0f

File tree

6 files changed

+37
-37
lines changed

6 files changed

+37
-37
lines changed

TMessagesProj/build.gradle

Lines changed: 9 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -234,6 +234,7 @@ android {
234234
}
235235
resources {
236236
excludes += ['/fabric/**', '/META-INF/*.version', '/META-INF/*.kotlin_module', '/META-INF/native-image/**', '/builddef.lst', '/*.txt', '/DebugProbesKt.bin', '/okhttp3/internal/publicsuffix/NOTICE']
237+
excludes += ["META-INF/INDEX.LIST"] // hutool
237238
}
238239

239240
def lib = "libtmessages.*.so"
@@ -353,16 +354,16 @@ dependencies {
353354
dependencies {
354355
implementation "androidx.browser:browser:1.8.0"
355356
implementation "androidx.viewpager:viewpager:1.0.0"
356-
implementation "org.jetbrains.kotlinx:kotlinx-coroutines-android:1.8.0"
357+
implementation "org.jetbrains.kotlinx:kotlinx-coroutines-android:1.9.0"
357358
// OSM
358-
implementation "org.osmdroid:osmdroid-android:6.1.10"
359+
implementation "org.osmdroid:osmdroid-android:6.1.20"
359360
// okhttp
360-
implementation "com.squareup.okhttp3:okhttp:5.0.0-alpha.14"
361+
implementation "com.squareup.okhttp3:okhttp:5.3.2"
361362
implementation 'dnsjava:dnsjava:3.6.3'
362363

363-
implementation "cn.hutool:hutool-core:5.7.13"
364-
implementation "cn.hutool:hutool-crypto:5.7.13"
365-
implementation 'cn.hutool:hutool-http:5.7.5'
364+
implementation "cn.hutool:hutool-core:5.8.42"
365+
implementation "cn.hutool:hutool-crypto:5.8.42"
366+
implementation 'cn.hutool:hutool-http:5.8.42'
366367
implementation "com.jakewharton:process-phoenix:3.0.0"
367368
// openpgp
368369
implementation project(":openpgp-api")
@@ -373,11 +374,11 @@ dependencies {
373374
// add for undo and redo
374375
implementation 'org.lsposed.hiddenapibypass:hiddenapibypass:6.1'
375376
// add splash screen
376-
implementation("androidx.core:core-splashscreen:1.0.1")
377+
implementation("androidx.core:core-splashscreen:1.2.0")
377378
// add for emoji
378379
implementation 'com.jaredrummler:truetypeparser-light:1.0.0'
379380
// add for up
380-
implementation 'org.unifiedpush.android:connector:2.5.0'
381+
implementation 'org.unifiedpush.android:connector:3.1.2'
381382
}
382383

383384
apply plugin: "com.google.gms.google-services"

TMessagesProj/proguard-rules.pro

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,7 @@
3434
-dontwarn com.google.android.gms.**
3535
-dontwarn com.google.common.cache.**
3636
-dontwarn com.google.common.primitives.**
37+
-dontwarn com.google.common.util.concurrent.ListenableFuture
3738
-dontwarn com.googlecode.mp4parser.**
3839

3940
-keep class com.google.android.datatransport.** { *; }
@@ -158,6 +159,9 @@
158159
-dontwarn org.slf4j.**
159160
-dontwarn org.w3c.dom.bootstrap.**
160161

162+
-dontwarn sun.misc.Unsafe
163+
-dontwarn org.bouncycastle.crypto.**
164+
-dontwarn org.bouncycastle.asn1.**
161165
-dontwarn sun.net.spi.nameservice.**
162166
-dontwarn com.sun.jna.**
163167
-dontwarn javax.naming.NamingException

TMessagesProj/src/main/AndroidManifest.xml

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -810,14 +810,12 @@
810810
<!-- android:permission="android.permission.BIND_REMOTEVIEWS"-->
811811
<!-- android:exported="false" />-->
812812

813-
<receiver android:exported="true" android:enabled="true" android:name=".UnifiedPushReceiver">
813+
<service android:name=".UnifiedPushService"
814+
android:exported="false">
814815
<intent-filter>
815-
<action android:name="org.unifiedpush.android.connector.MESSAGE"/>
816-
<action android:name="org.unifiedpush.android.connector.UNREGISTERED"/>
817-
<action android:name="org.unifiedpush.android.connector.NEW_ENDPOINT"/>
818-
<action android:name="org.unifiedpush.android.connector.REGISTRATION_FAILED"/>
816+
<action android:name="org.unifiedpush.android.connector.PUSH_EVENT"/>
819817
</intent-filter>
820-
</receiver>
818+
</service>
821819
<service android:name=".GcmPushListenerService"
822820
android:exported="true">
823821
<intent-filter>

TMessagesProj/src/main/java/org/telegram/messenger/UnifiedPushListenerServiceProvider.java

Lines changed: 6 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -5,15 +5,14 @@
55

66
import org.unifiedpush.android.connector.UnifiedPush;
77

8-
import java.util.ArrayList;
98
import java.util.List;
109

1110
public class UnifiedPushListenerServiceProvider implements PushListenerController.IPushListenerServiceProvider {
12-
public UnifiedPushListenerServiceProvider(){};
11+
public UnifiedPushListenerServiceProvider(){}
1312

1413
@Override
1514
public boolean hasServices() {
16-
return !UnifiedPush.getDistributors(ApplicationLoader.applicationContext, new ArrayList<>()).isEmpty();
15+
return !UnifiedPush.getDistributors(ApplicationLoader.applicationContext).isEmpty();
1716
}
1817

1918
@Override
@@ -38,16 +37,16 @@ public void onRequestPushToken() {
3837
SharedConfig.pushStringGetTimeStart = SystemClock.elapsedRealtime();
3938
SharedConfig.saveConfig();
4039
if (UnifiedPush.getAckDistributor(ApplicationLoader.applicationContext) == null) {
41-
List<String> distributors = UnifiedPush.getDistributors(ApplicationLoader.applicationContext, new ArrayList<>());
42-
if (distributors.size() > 0) {
40+
List<String> distributors = UnifiedPush.getDistributors(ApplicationLoader.applicationContext);
41+
if (!distributors.isEmpty()) {
4342
String distributor = distributors.get(0);
4443
UnifiedPush.saveDistributor(ApplicationLoader.applicationContext, distributor);
4544
}
4645
}
47-
UnifiedPush.registerApp(
46+
UnifiedPush.register(
4847
ApplicationLoader.applicationContext,
4948
"default",
50-
new ArrayList<>(),
49+
null,
5150
"Telegram Simple Push"
5251
);
5352
} catch (Throwable e) {

TMessagesProj/src/main/java/org/telegram/messenger/UnifiedPushReceiver.java renamed to TMessagesProj/src/main/java/org/telegram/messenger/UnifiedPushService.java

Lines changed: 14 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -1,22 +1,22 @@
11
package org.telegram.messenger;
22

3-
import android.content.Context;
43
import android.os.SystemClock;
54

6-
import androidx.annotation.NonNull;
7-
85
import org.telegram.tgnet.ConnectionsManager;
96

10-
import org.unifiedpush.android.connector.MessagingReceiver;
7+
import org.unifiedpush.android.connector.FailedReason;
8+
import org.unifiedpush.android.connector.PushService;
119
import org.unifiedpush.android.connector.UnifiedPush;
10+
import org.unifiedpush.android.connector.data.PushEndpoint;
11+
import org.unifiedpush.android.connector.data.PushMessage;
1212

1313
import java.io.UnsupportedEncodingException;
1414
import java.net.URLEncoder;
1515
import java.util.concurrent.CountDownLatch;
1616

1717
import xyz.nextalone.nagram.NaConfig;
1818

19-
public class UnifiedPushReceiver extends MessagingReceiver {
19+
public class UnifiedPushService extends PushService {
2020

2121
private static long lastReceivedNotification = 0;
2222
private static long numOfReceivedNotifications = 0;
@@ -30,27 +30,26 @@ public static long getNumOfReceivedNotifications() {
3030
}
3131

3232
@Override
33-
public void onNewEndpoint(Context context, String endpoint, String instance){
33+
public void onNewEndpoint(PushEndpoint endpoint, String instance){
3434
Utilities.globalQueue.postRunnable(() -> {
3535
SharedConfig.pushStringGetTimeEnd = SystemClock.elapsedRealtime();
3636

37-
String savedDistributor = UnifiedPush.getSavedDistributor(context);
37+
String savedDistributor = UnifiedPush.getSavedDistributor(this);
3838

39-
if (savedDistributor.equals("io.heckel.ntfy")) {
40-
PushListenerController.sendRegistrationToServer(PushListenerController.PUSH_TYPE_SIMPLE, endpoint);
39+
if ("io.heckel.ntfy".equals(savedDistributor)) {
40+
PushListenerController.sendRegistrationToServer(PushListenerController.PUSH_TYPE_SIMPLE, endpoint.getUrl());
4141
return;
4242
}
4343

4444
try {
45-
PushListenerController.sendRegistrationToServer(PushListenerController.PUSH_TYPE_SIMPLE, NaConfig.INSTANCE.getPushServiceTypeUnifiedGateway().String() + URLEncoder.encode(endpoint, "UTF-8"));
46-
} catch (UnsupportedEncodingException e) {
47-
FileLog.e(e);
45+
PushListenerController.sendRegistrationToServer(PushListenerController.PUSH_TYPE_SIMPLE, NaConfig.INSTANCE.getPushServiceTypeUnifiedGateway().String() + URLEncoder.encode(endpoint.getUrl(), "UTF-8"));
46+
} catch (UnsupportedEncodingException ignored) {
4847
}
4948
});
5049
}
5150

5251
@Override
53-
public void onMessage(Context context, byte[] message, String instance){
52+
public void onMessage(PushMessage message, String instance){
5453
final long receiveTime = SystemClock.elapsedRealtime();
5554
final CountDownLatch countDownLatch = new CountDownLatch(1);
5655

@@ -91,7 +90,7 @@ public void onMessage(Context context, byte[] message, String instance){
9190
}
9291

9392
@Override
94-
public void onRegistrationFailed(Context context, String instance){
93+
public void onRegistrationFailed(FailedReason reason, String instance){
9594
if (BuildVars.LOGS_ENABLED) {
9695
FileLog.d("Failed to get endpoint");
9796
}
@@ -104,7 +103,7 @@ public void onRegistrationFailed(Context context, String instance){
104103
}
105104

106105
@Override
107-
public void onUnregistered(Context context, String instance){
106+
public void onUnregistered(String instance){
108107
SharedConfig.pushStringStatus = "__UNIFIEDPUSH_FAILED__";
109108
Utilities.globalQueue.postRunnable(() -> {
110109
SharedConfig.pushStringGetTimeEnd = SystemClock.elapsedRealtime();

build.gradle

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,6 @@ buildscript {
1313
classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:2.1.0"
1414

1515
//noinspection GradleDependency
16-
classpath 'cn.hutool:hutool-core:5.7.13'
1716
classpath "io.sentry:sentry-android-gradle-plugin:5.12.2"
1817
// db
1918
classpath "io.objectbox:objectbox-gradle-plugin:5.0.1"

0 commit comments

Comments
 (0)