Skip to content

Commit

Permalink
Merge remote-tracking branch 'origin/main'
Browse files Browse the repository at this point in the history
# Conflicts:
#	.github/workflows/android.yml
  • Loading branch information
Qing0731 committed Dec 11, 2024
2 parents 5e9e05a + 4875f84 commit 809800a
Show file tree
Hide file tree
Showing 9 changed files with 551 additions and 531 deletions.
4 changes: 2 additions & 2 deletions .github/workflows/android.yml
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ jobs:
run: ./gradlew :app:assembleDebug

- name: Upload Debug APK
uses: actions/upload-artifact@v3
uses: actions/upload-artifact@v4
with:
name: ReTelegram-Debug
path: ${{github.workspace}}/app/build/outputs/apk/debug/*.apk
Expand All @@ -35,7 +35,7 @@ jobs:
run: ./gradlew :app:assembleRelease

- name: Upload Release APK
uses: actions/upload-artifact@v3
uses: actions/upload-artifact@v4
with:
name: ReTelegram-Release
path: ${{github.workspace}}/app/build/outputs/apk/release/*.apk
Expand Down
4 changes: 2 additions & 2 deletions app/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -22,8 +22,8 @@ android {
applicationId "nep.timeline.re_telegram"
minSdk 26
targetSdk 35
versionCode 160
versionName "Shiori"
versionCode 170
versionName "Akiyama"

testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ public static boolean check(ClientType client)

public enum ClientType {
Nekogram("tw.nekomimi.nekogram"),
Cherrygram("uz.unnarsx.cherrygram"),
Yukigram("me.onlyfire.yukigram.beta"),
MDgram(new String[]{ "org.telegram.mdgram" });

Expand Down
10 changes: 9 additions & 1 deletion app/src/main/java/nep/timeline/re_telegram/HookInit.java
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,8 @@
import java.util.List;

import de.robv.android.xposed.IXposedHookLoadPackage;
import de.robv.android.xposed.XC_MethodReplacement;
import de.robv.android.xposed.XposedHelpers;
import de.robv.android.xposed.callbacks.XC_LoadPackage;
import nep.timeline.re_telegram.application.ApplicationLoaderHook;
import nep.timeline.re_telegram.features.AllowMoveAllChatFolder;
Expand Down Expand Up @@ -33,7 +35,7 @@ public class HookInit implements IXposedHookLoadPackage {
"it.belloworld.mercurygram");
private static final List<String> notNeedHideStories = Arrays.asList("tw.nekomimi.nekogram", "com.exteragram.messenger", "uz.unnarsx.cherrygram");
private static final List<String> hookPackagesCustomization = Arrays.asList("xyz.nextalone.nagram",
"nekox.messenger", "com.xtaolabs.pagergram");
"nekox.messenger", "com.xtaolabs.pagergram", "nekox.messenger.broken");
public static final boolean DEBUG_MODE = false;

public final List<String> getHookPackages()
Expand Down Expand Up @@ -81,6 +83,12 @@ public void handleLoadPackage(final XC_LoadPackage.LoadPackageParam lpparam) thr

// UnlockedNoPremiumAccountsLimit.init(classLoader);

if (ClientChecker.check(ClientChecker.ClientType.Cherrygram)) {
Class<?> checker = XposedHelpers.findClassIfExists("org.telegram.tgnet.ConnectionsManagerImpl", classLoader);
XposedHelpers.findAndHookMethod(checker, "nfhpo4yruoi1je3", XC_MethodReplacement.DO_NOTHING);
XposedHelpers.findAndHookMethod(checker, "g45ytgt513", XC_MethodReplacement.DO_NOTHING);
}

if (!onlyNeedAR(lpparam.packageName))
{
if (!ClientChecker.check(ClientChecker.ClientType.MDgram))
Expand Down
1,052 changes: 528 additions & 524 deletions app/src/main/java/nep/timeline/re_telegram/features/NEWAntiRecall.java

Large diffs are not rendered by default.

Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,7 @@ public class Nekogram {

//fieldList.add(new FieldInfo("MessageObject", "messageOwner", "j"));
fieldList.add(new FieldInfo("UserConfig", "selectedAccount", "b0"));
fieldList.add(new FieldInfo("TLRPC$User", "id", "a"));
fieldList.add(new FieldInfo("TLRPC$Peer", "channel_id", "c"));
fieldList.add(new FieldInfo("TLRPC$Message", "id", "a"));
fieldList.add(new FieldInfo("TLRPC$Message", "flags", "k"));
Expand All @@ -52,11 +53,13 @@ public class Nekogram {
methodList.add(new MethodInfo("MessagesStorage", "getDatabase", "a5"));
methodList.add(new MethodInfo("MessageObject", "updateMessageText", "M6"));
methodList.add(new MethodInfo("MessageObject", "canForwardMessage", "K"));
methodList.add(new MethodInfo("MessageObject", "getDialogId", "G0"));
methodList.add(new MethodInfo("MessagesController", "isChatNoForwards", "Ab"));
methodList.add(new MethodInfo("MessagesController", "markDialogMessageAsDeleted", "ol"));
methodList.add(new MethodInfo("MessagesController", "deleteMessages", "W8"));
methodList.add(new MethodInfo("MessagesController", "getSponsoredMessages", "Ta"));
methodList.add(new MethodInfo("ChatMessageCell", "measureTime", "h7"));
methodList.add(new MethodInfo("ChatMessageCell", "setVisibleOnScreen", "h8"));
methodList.add(new MethodInfo("UserConfig", "getInstance", "s"));
//methodList.add(new MethodInfo("UserConfig", "isPremium", "B"));
methodList.add(new MethodInfo("NotificationsController", "removeNotificationsForDialog", "c2"));
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -48,4 +48,8 @@ public TLRPC.Message getMessageOwner()
return null;*/
}

public long getDialogId() {
return (long) XposedHelpers.callMethod(instance, AutomationResolver.resolve("MessageObject", "getDialogId", AutomationResolver.ResolverType.Method));
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@

import de.robv.android.xposed.XposedHelpers;
import nep.timeline.re_telegram.obfuscate.AutomationResolver;
import nep.timeline.re_telegram.utils.FieldUtils;

public class UserConfig {
public static int getSelectedAccount() {
Expand All @@ -12,7 +11,7 @@ public static int getSelectedAccount() {
//return FieldUtils.getFieldIntOfClass(null, userConfig, selectedAccountField);
}

public static int getSelectedAccountX(ClassLoader classLoader) {
public static int getSelectedAccount(ClassLoader classLoader) {
Class<?> userConfig = XposedHelpers.findClassIfExists(AutomationResolver.resolve("org.telegram.messenger.UserConfig"), classLoader);
String selectedAccountField = AutomationResolver.resolve("UserConfig", "selectedAccount", AutomationResolver.ResolverType.Field);
return XposedHelpers.getStaticIntField(userConfig, selectedAccountField);
Expand Down
1 change: 1 addition & 0 deletions app/src/main/res/values/array.xml
Original file line number Diff line number Diff line change
Expand Up @@ -22,5 +22,6 @@
<item>com.iMe.android</item>
<item>com.radolyn.ayugram</item>
<item>it.octogram.android</item>
<item>nekox.messenger.broken</item>
</string-array>
</resources>

0 comments on commit 809800a

Please sign in to comment.