Skip to content

Commit

Permalink
Merge pull request #1 from Keeperorowner/main
Browse files Browse the repository at this point in the history
* Remove Config Setting
Remove all functions except for anti recall


Co-authored-by: 86189 <[email protected]>
  • Loading branch information
Keeperorowner and Qing0731 authored Dec 11, 2024
2 parents 4875f84 + 9f9e0a4 commit e44a376
Show file tree
Hide file tree
Showing 20 changed files with 72 additions and 1,171 deletions.
8 changes: 4 additions & 4 deletions .github/workflows/android.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,10 +13,10 @@ jobs:
- name: Checkout source code
uses: actions/checkout@v2

- name: set up JDK 21
- name: set up JDK 17
uses: actions/setup-java@v1
with:
java-version: 21
java-version: 17

- name: Grant execute permission for gradlew
run: chmod +x gradlew
Expand All @@ -28,7 +28,7 @@ jobs:
uses: actions/upload-artifact@v4
with:
name: ReTelegram-Debug
path: ${{ github.workspace }}/app/build/outputs/apk/debug/*.apk
path: ${{github.workspace}}/app/build/outputs/apk/debug/*.apk
if-no-files-found: warn

- name: Build Release with Gradle
Expand All @@ -38,5 +38,5 @@ jobs:
uses: actions/upload-artifact@v4
with:
name: ReTelegram-Release
path: ${{ github.workspace }}/app/build/outputs/apk/release/*.apk
path: ${{github.workspace}}/app/build/outputs/apk/release/*.apk
if-no-files-found: warn
4 changes: 2 additions & 2 deletions app/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -30,8 +30,8 @@ android {

buildTypes {
release {
minifyEnabled true
shrinkResources true
minifyEnabled false
shrinkResources false
proguardFiles getDefaultProguardFile('proguard-android-optimize.txt'), 'proguard-rules.pro'
}
}
Expand Down
2 changes: 1 addition & 1 deletion app/src/main/AndroidManifest.xml
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
android:value="true" />
<meta-data
android:name="xposeddescription"
android:value="An Xposed module to enhance the Telegram." />
android:value="A Telegram anti recall module." />
<meta-data
android:name="xposedminversion"
android:value="82" />
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,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" });
Yukigram("me.onlyfire.yukigram.beta"),;

final String[] packageNames;

Expand All @@ -26,11 +25,6 @@ public enum ClientType {
this.packageNames = new String[]{ packageName };
}

ClientType(String[] packageNames)
{
this.packageNames = packageNames;
}

public String[] getPackageNames()
{
return packageNames;
Expand Down
35 changes: 7 additions & 28 deletions app/src/main/java/nep/timeline/re_telegram/HookInit.java
Original file line number Diff line number Diff line change
Expand Up @@ -9,17 +9,10 @@
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;
import nep.timeline.re_telegram.features.AntiAntiForward;
import nep.timeline.re_telegram.features.AntiRecallWithDatabase;
import nep.timeline.re_telegram.features.HideStories;
import nep.timeline.re_telegram.features.NEWAntiRecall;
import nep.timeline.re_telegram.features.NoSponsoredMessages;
import nep.timeline.re_telegram.features.ProhibitChannelSwitching;
import nep.timeline.re_telegram.features.UseSystemTypeface;

public class HookInit implements IXposedHookLoadPackage {
private static final List<String> hookPackages = Arrays.asList("org.telegram.messenger", "org.telegram.messenger.web", "org.telegram.messenger.beta", "org.telegram.plus", "org.telegram.mdgram",
private static final List<String> hookPackages = Arrays.asList("org.telegram.messenger", "org.telegram.messenger.web", "org.telegram.messenger.beta", "org.telegram.plus",
"tw.nekomimi.nekogram",
"com.cool2645.nekolite",
"com.exteragram.messenger",
Expand All @@ -33,7 +26,6 @@ public class HookInit implements IXposedHookLoadPackage {
"it.octogram.android",
"xyz.nextalone.nnngram",
"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.broken");
public static final boolean DEBUG_MODE = false;
Expand All @@ -45,13 +37,8 @@ public final List<String> getHookPackages()
return hookPackagesLocal;
}

private boolean onlyNeedAR(String pkgName)
{
return hookPackagesCustomization.contains(pkgName);
}

@Override
public void handleLoadPackage(final XC_LoadPackage.LoadPackageParam lpparam) throws Throwable {
public void handleLoadPackage(final XC_LoadPackage.LoadPackageParam lpparam) {
if (getHookPackages().contains(lpparam.packageName))
{
if (DEBUG_MODE)
Expand All @@ -62,34 +49,24 @@ public void handleLoadPackage(final XC_LoadPackage.LoadPackageParam lpparam) thr

ApplicationLoaderHook.init(classLoader);

if (ClientChecker.check(ClientChecker.ClientType.Yukigram)) {
AntiRecallWithDatabase.initUI(classLoader);

AntiRecallWithDatabase.initProcessing(classLoader);

AntiRecallWithDatabase.init(classLoader);
} else {
NEWAntiRecall.initUI(classLoader);

NEWAntiRecall.initProcessing(classLoader);

NEWAntiRecall.init(classLoader);
}

// FakePremium.init(classLoader);

if (!ClientChecker.check(ClientChecker.ClientType.Nekogram))
AllowMoveAllChatFolder.init(classLoader);
//AllowMoveAllChatFolder.init(classLoader);

// 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 (!onlyNeedAR(lpparam.packageName))
{
if (!ClientChecker.check(ClientChecker.ClientType.MDgram))
UseSystemTypeface.init(classLoader);
Expand All @@ -106,6 +83,8 @@ public void handleLoadPackage(final XC_LoadPackage.LoadPackageParam lpparam) thr
AntiAntiForward.init(classLoader);
}
*/
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -2,15 +2,10 @@

import android.app.Application;
import android.content.Context;
import android.widget.Toast;

import java.io.File;
import java.io.IOException;

import de.robv.android.xposed.XC_MethodHook;
import de.robv.android.xposed.XposedHelpers;
import nep.timeline.re_telegram.Utils;
import nep.timeline.re_telegram.configs.ConfigManager;
import nep.timeline.re_telegram.obfuscate.AutomationResolver;

public class ApplicationLoaderHook {
Expand Down Expand Up @@ -46,36 +41,32 @@ protected void beforeHookedMethod(MethodHookParam param) {
return;
}

File dir = new File(app.getFilesDir().getParentFile(), "Re-Telegram");
/* File dir = new File(app.getFilesDir().getParentFile(), "Re-Telegram");
if (!dir.exists())
if (!dir.mkdir())
{
Toast.makeText(app, "Cannot create " + dir.getAbsolutePath() + " dir, please create by yourself!", Toast.LENGTH_LONG).show();
Utils.log("Cannot create " + dir.getAbsolutePath() + " dir, please create by yourself!");
return;
}
//Utils.deletedMessagesSavePath = new File(dir.getAbsolutePath() + "/deletedMessages.list");
Utils.deletedMessagesSavePath = new File(dir.getAbsolutePath() + "/deletedMessages.list");
Utils.deletedMessagesDatabasePath = new File(dir.getAbsolutePath() + "/deletedMessages.db");
ConfigManager.cfgPath = new File(dir.getAbsolutePath() + "/configs.cfg");
try
{
if (!ConfigManager.cfgPath.exists())
{
ConfigManager.cfgPath.createNewFile();
ConfigManager.save();
}
if (!ConfigManager.cfgPath.exists())
{
ConfigManager.cfgPath.createNewFile();
ConfigManager.save();
}
//Utils.readDeletedMessages();
ConfigManager.read();
ConfigManager.save();
HostApplicationInfo.setApplication(app);
}
catch (IOException e)
{
Utils.log(e);
}
//Utils.readDeletedMessages();
ConfigManager.read();
ConfigManager.save();
*/
HostApplicationInfo.setApplication(app);
}
});

initialized = true;
}
}

This file was deleted.

Loading

0 comments on commit e44a376

Please sign in to comment.